Merge pull request #103 from Kjwon15/feature-asyncstream
Implement is_alive to async stream
This commit is contained in:
commit
32adb8ce4b
S'han modificat 1 arxius amb 4 adicions i 0 eliminacions
|
@ -1306,7 +1306,11 @@ class Mastodon:
|
|||
def close(self):
|
||||
self.connection.close()
|
||||
|
||||
def is_alive(self):
|
||||
return self._thread.is_alive()
|
||||
|
||||
def _threadproc(self):
|
||||
self._thread = threading.current_thread()
|
||||
with closing(connection) as r:
|
||||
try:
|
||||
listener.handle_stream(r.iter_lines())
|
||||
|
|
Loading…
Referencia en una nova incidència