U
vi_ @ s d dl m Z d dlmZmZmZ d dlmZmZmZ d dlm Z edZ
d
ejeej eee
gee
f ddd Z
d gZdS ) )datetime)CallableOptionalTypeVar)
Observableabctyping)TimeoutScheduler_TN)window_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 an observable that emits only the first item emitted
by the source Observable during sequential time windows of a
specified duration.
Args:
source: Source observable to throttle.
Returns:
An Observable that performs the throttle operation.
N)observer
scheduler_r
c sj p|pt pd dkr4tdd td d fdd}j|jj dS )Ng r z-window_duration cannot be less or equal zero.)xr
c sF d} j }j r"| kr*|d}W 5 Q R X |rB| d S )NFT)nowlockon_next)r emitr )
_schedulerdurationlast_on_nextr r S/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_throttlefirst.pyr $ s zKthrottle_first_.