diff options
author | kjwon15 <[email protected]> | 2017-11-25 02:45:47 +0900 |
---|---|---|
committer | kjwon15 <[email protected]> | 2017-11-25 02:52:00 +0900 |
commit | fa1840c0fb91a3ac8ff48b37bbe78f63623397ec (patch) | |
tree | 7ff85b0aa45cdd494223dcbde3e001d0ea6289b8 /mastodon | |
parent | da438529e082c85307659b765681abe9eb214ff5 (diff) | |
download | mastodon.py-fa1840c0fb91a3ac8ff48b37bbe78f63623397ec.tar.gz |
Implement is_alive to async stream
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 88f4906..1802cd1 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -1305,10 +1305,14 @@ class Mastodon: | |||
1305 | class __stream_handle(): | 1305 | class __stream_handle(): |
1306 | def __init__(self, connection): | 1306 | def __init__(self, connection): |
1307 | self.connection = connection | 1307 | self.connection = connection |
1308 | self._thread = threading.current_thread() | ||
1308 | 1309 | ||
1309 | def close(self): | 1310 | def close(self): |
1310 | self.connection.close() | 1311 | self.connection.close() |
1311 | 1312 | ||
1313 | def is_alive(self): | ||
1314 | return self._thread.is_alive() | ||
1315 | |||
1312 | def _threadproc(self): | 1316 | def _threadproc(self): |
1313 | with closing(connection) as r: | 1317 | with closing(connection) as r: |
1314 | try: | 1318 | try: |