U
vi" @ s d dl mZmZmZmZmZmZ d dlmZm Z m Z d dl
mZ edZd e j
ee j eee gee f dddZdgZdS )
)AnyCallableDictListOptionalTypeVar)
Observableabctyping)TimeoutScheduler_TN)duration schedulerreturnc s" t t t t d fdd}|S )N)sourcer c s2 dt jt tt j t jd fdd
}t|S )a Returns elements within the specified duration from the end
of the observable source sequence.
Example:
>>> res = take_last_with_time(source)
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 taking elements from the end of the
sequence.
Returns:
An observable sequence with the elements taken during the
specified duration from the end of the source sequence.
N)observer
scheduler_r c s\ p|pt g td d fdd} fdd}j|j||dS )N)xr c s> j }|| d r:|d d kr:d qd S )N)intervalvaluer r )nowappendpop)r r )
_schedulerr
q V/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_takelastwithtime.pyon_next, s zUtake_last_with_time_.