U
vi @ sf d dl Z d dlmZmZmZ d dlmZ d dlmZ ddl m
Z
e ZedZe
e edd d
Z
dS ) N)OptionalTypeVarcast)SequenceContainsNoElementsError)NewThreadScheduler )
Observable_T)sourcereturnc s dt dttdd tddfdd}tdd fdd}dd fd
d}| j|||td s qrrttstS )
a` Run source synchronously.
Subscribes to the observable source. Then blocks and waits for the
observable source to either complete or error. Returns the
last value emitted, or throws exception if any error occured.
Examples:
>>> result = run(source)
Args:
source: Observable source to run.
Raises:
SequenceContainsNoElementsError: if observable completes
(on_completed) without any values being emitted.
Exception: raises exception if any error (on_error) occured.
Returns:
The last element emitted from the observable.
NF)valuer c s | d d S NT )r )
has_resultresultr >/opt/alt/python38/lib/python3.8/site-packages/reactivex/run.pyon_next) s zrun.