U vi0 @sddlmZmZmZmZmZmZddlmZm Z mZddl m Z edZ d ej ee jeee gee fdddZdgZdS) )AnyCallableDictListOptionalTypeVar) Observableabctyping)TimeoutScheduler_TN)duration schedulerreturncs"ttttdfdd }|S)a Skips elements for the specified duration from the end of the observable source sequence. Example: >>> res = skip_last_with_time(5.0) This operator accumulates a queue with a length enough to store elements received during the initial duration window. As more elements are received, elements older than the specified duration are taken from the queue and produced on the result sequence. This causes elements to be delayed with duration. Args: duration: Duration for skipping elements from the end of the sequence. scheduler: Scheduler to use for time handling. Returns: An observable sequence with the elements skipped during the specified duration from the end of the source sequence. )sourcercs2dtjtttjtjdfdd }t|S)N)observer scheduler_rcsdp|ptgtddfdd }ddfdd }j|j|dS)N)xrcsHj}||drD|ddkrDddqdS)N)intervalvaluerrr)nowappendon_nextpop)rr _schedulerr rqV/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_skiplastwithtime.pyr/szUskip_last_with_time_..skip_last_with_time..subscribe..on_next)rcs@j}r4|ddkr4ddqdS)Nrrr)rrr on_completed)rrrrr5szZskip_last_with_time_..skip_last_with_time..subscribe..on_completed)r)r Z singletonZ to_timedeltar subscribeZon_error)rrrr)r rr)rrrrr #s zDskip_last_with_time_..skip_last_with_time..subscribe)N)r Z ObserverBaser r SchedulerBaseZDisposableBaser)rr r r)rrskip_last_with_time"sz1skip_last_with_time_..skip_last_with_time)rr )r rr#rr"rskip_last_with_time_ s r$)N)r rrrrrrZ reactivexrr Zreactivex.schedulerr r Z RelativeTimer!r$__all__rrrrs   <