U
vi8 @ s d dl mZmZmZmZ d dlZd dlmZmZ d dlm Z m
Z
mZ edZd eee eeegee f eee eee gee f dddZ
dgZdS )
)AnyCallableOptionalTypeVarN)
Observableabc)CompositeDisposableSerialDisposableSingleAssignmentDisposable_T)
first_timeouttimeout_duration_mapperotherreturnc sB | p
t |pt tdtt tt d fdd}|S )a Returns the source observable sequence, switching to the other
observable sequence if a timeout is signaled.
res = timeout_with_mapper(reactivex.timer(500))
res = timeout_with_mapper(reactivex.timer(500), lambda x: reactivex.timer(200))
res = timeout_with_mapper(
reactivex.timer(500),
lambda x: reactivex.timer(200)),
reactivex.return_value(42)
)
Args:
first_timeout -- [Optional] Observable sequence that represents the
timeout for the first element. If not provided, this defaults to
reactivex.never().
timeout_duration_mapper -- [Optional] Selector to retrieve an
observable sequence that represents the timeout between the
current element and the next element.
other -- [Optional] Sequence to return in case of a timeout. If not
provided, this is set to reactivex.throw().
Returns:
The source sequence switching to the other sequence in case
of a timeout.
Timeout)sourcer c s4 dt jt tt j t jd fdd
}t|S )N)observer schedulerr c s t t t }|_ddg tt d d fdd fddtd dfd d
}td dfdd
}d dfdd}
j|||d|_tS )NFr )timeoutr c s d fddt _td d fdd}td dfdd }d d
fdd}| j|||d
_d S )Nr c s d kS )Nr r )_idmy_idr W/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_timeoutwithmapper.py
timer_winsA s zktimeout_with_mapper_.