parent
d3579fae90
commit
0dda7e7227
@ -1,11 +1,10 @@
|
|||||||
from queue import Queue
|
from queue import Queue
|
||||||
from threading import Thread
|
from threading import Thread, current_thread
|
||||||
from typing import Any, Callable, Optional, TypeVar
|
from typing import Any, Callable, Optional, TypeVar
|
||||||
|
|
||||||
from reactivex import Observable, abc
|
from reactivex import Observable, abc
|
||||||
from reactivex.disposable import CompositeDisposable, Disposable, SerialDisposable
|
from reactivex.disposable import CompositeDisposable, Disposable, SerialDisposable
|
||||||
|
|
||||||
|
|
||||||
_T = TypeVar('_T')
|
_T = TypeVar('_T')
|
||||||
|
|
||||||
|
|
||||||
@ -41,7 +40,8 @@ def observe_on_new_thread(
|
|||||||
nonlocal disposed
|
nonlocal disposed
|
||||||
disposed = True
|
disposed = True
|
||||||
queue.put(lambda: None)
|
queue.put(lambda: None)
|
||||||
thread.join()
|
if thread is not current_thread():
|
||||||
|
thread.join()
|
||||||
|
|
||||||
subscription.disposable = source.subscribe(
|
subscription.disposable = source.subscribe(
|
||||||
on_next, on_error, on_completed, scheduler=scheduler
|
on_next, on_error, on_completed, scheduler=scheduler
|
||||||
|
Loading…
Reference in New Issue
Block a user