U vi @ s d dl mZ d dlmZmZmZmZ d dlZd dlmZm Z d dl mZmZ edZ eeee gee f ddd Zd gZdS ) )Future)CallableOptionalTypeVarUnionN) Observableabc)CompositeDisposableSingleAssignmentDisposable_Treturnc C s t t t t t ddd} | 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 c s. dt jt tt j t jd fdd }t|S )N)observer schedulerr c s| dgdgt }t | ttt df d d fdd}d d fdd}j|j|d |_ S ) NFz Future[_T])inner_sourcer c sh d sddd<