U vi @sddlmZddlmZmZmZmZddlZddlmZm Z ddl m Z m Z edZ eeee gee fddd Zd gZdS) )Future)CallableOptionalTypeVarUnionN) Observableabc)CompositeDisposableSingleAssignmentDisposable_TreturncCs tttttddd}|S)a!Performs a exclusive waiting for the first to finish before subscribing to another observable. Observables that come in between subscriptions will be dropped on the floor. Returns: An exclusive observable with only the results that happen when subscribed. )sourcer cs.dtjtttjtjdfdd }t|S)N)observer schedulerr cs|dgdgt}t|tttdfddfdd }ddfdd }j|j|d |_S) NFz Future[_T]) inner_sourcer cshdsddd<t|tr$t|n|}tfdd}|jjj|d_ dS)NrTcs2dd<dr.tdkr.dS)NFr)removelen on_completed)g has_currentinner_subscription is_stoppedrrO/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_exclusive.pyon_completed_inner.s z]exclusive_..exclusive..subscribe..on_next..on_completed_innerr) isinstancer reactivexZ from_futurer add subscribeon_nexton_error disposable)rrrrrrr)rrr"!s  zAexclusive_..exclusive..subscribe..on_nextr cs(dd<ds$tdkr$dS)NTrr)rrr)rrrrrrr;szFexclusive_..exclusive..subscribe..on_completedr) r r r rrr r!r#r$)rrmr"rrr%rr!s (z0exclusive_..exclusive..subscribe)N)rZ ObserverBaser rZ SchedulerBaseZDisposableBaser)rr!rr'r exclusives/zexclusive_..exclusive)rr )r(rrr exclusive_ s 2r))asynciortypingrrrrrrrZreactivex.disposabler r r r)__all__rrrrs $?