diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index c4e50f3..91e6b11 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -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())