Implement is_alive to async stream
This commit is contained in:
pare
da438529e0
commit
fa1840c0fb
S'han modificat 1 arxius amb 4 adicions i 0 eliminacions
|
@ -1305,10 +1305,14 @@ class Mastodon:
|
||||||
class __stream_handle():
|
class __stream_handle():
|
||||||
def __init__(self, connection):
|
def __init__(self, connection):
|
||||||
self.connection = connection
|
self.connection = connection
|
||||||
|
self._thread = threading.current_thread()
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.connection.close()
|
self.connection.close()
|
||||||
|
|
||||||
|
def is_alive(self):
|
||||||
|
return self._thread.is_alive()
|
||||||
|
|
||||||
def _threadproc(self):
|
def _threadproc(self):
|
||||||
with closing(connection) as r:
|
with closing(connection) as r:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Referencia en una nova incidència