Merge pull request #103 from Kjwon15/feature-asyncstream

Implement is_alive to async stream
pull/107/head
Lorenz Diener 2017-11-27 13:50:31 +01:00 zatwierdzone przez GitHub
commit 32adb8ce4b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

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