U
vâ’i—
ã @ sš d dl mZmZmZmZmZ d dlmZmZ d dl m
Z
d dlmZ d dl
mZmZmZ edƒZeee eeef eegef ee dœdd „Zd gZd
S )é )ÚAnyÚCallableÚOptionalÚTypeVarÚcast)Ú
ObservableÚabc)ÚMultipleAssignmentDisposable)ÚTimeoutScheduler)ÚMapperÚ PredicateÚRelativeTimeÚ_TState)Ú
initial_stateÚ conditionÚiterateÚtime_mapperÚreturnc s4 dt jt tt j t jdœ‡ ‡‡‡fdd„
}t|ƒS )a¾ Generates an observable sequence by iterating a state from an
initial state until the condition fails.
Example:
res = source.generate_with_relative_time(
0, lambda x: True, lambda x: x + 1, lambda x: 0.5
)
Args:
initial_state: Initial state.
condition: Condition to terminate generation (upon returning
false).
iterate: Iteration step function.
time_mapper: Time mapper function to control the speed of
values being produced each iteration, returning relative
times, i.e. either floats denoting seconds or instances of
timedelta.
Returns:
The generated sequence.
N)ÚobserverÚ schedulerr c sj |p
t ¡ }tƒ ‰ˆ ‰d‰ttd ƒ‰d‰d ‰tjtd dœ‡ ‡‡‡‡
‡‡‡‡‡‡fdd„‰ | dˆ ¡ˆ_ ˆS )NFT)r Ú_r c
s˜ ˆrˆ ˆ¡ z.ˆrd‰nˆˆƒ‰ˆˆƒ‰ˆr:ˆ‰ˆ
ˆƒ‰ W n2 tk
rn } zˆ |¡ W Y ¢d S d }~X Y nX ˆrŒˆ s|t‚| ˆ ˆ ¡ˆ_nˆ ¡ d S )NF)Zon_nextÚ ExceptionZon_errorÚAssertionErrorÚschedule_relativeÚ
disposableZon_completed)r r Úe)Úactionr ÚfirstÚ
has_resultr Úmadr ÚresultÚstateÚtimer © ú^/opt/alt/python38/lib/python3.8/site-packages/reactivex/observable/generatewithrelativetime.pyr 3 s"
z?generate_with_relative_time_.