Merge pull request #103 from Kjwon15/feature-asyncstream

Implement is_alive to async stream
This commit is contained in:
Lorenz Diener 2017-11-27 13:50:31 +01:00 cometido por GitHub
commit 32adb8ce4b
No se encontró ninguna clave conocida en la base de datos para esta firma
ID de clave GPG: 4AEE18F83AFDEB23

Veure arxiu

@ -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())