U
vie @ s~ d dl Z d dlmZ d dlmZmZmZ d dlmZmZ d dlm Z m
Z
mZ ddlm
Z
edZe d ZG d
d de
ZdS ) N)datetime)AnyOptionalTypeVar)abctyping)CompositeDisposable
DisposableSingleAssignmentDisposable )PeriodicScheduler_TStateZRxc s e Zd ZdZedd fddZdeje e e e
jdddZdej
eje e e e
jd d
dZdejeje e e e
jd dd
ZeedddZ ZS )IOLoopSchedulerzA scheduler that schedules work via the Tornado I/O main event loop.
Note, as of Tornado 6, this is just a wrapper around the asyncio loop.
http://tornado.readthedocs.org/en/latest/ioloop.htmlN)loopreturnc s t || _dS )zCreate a new IOLoopScheduler.
Args:
loop: The ioloop to use; typically, you would get this by
tornado import ioloop; ioloop.IOLoop.current()
N)super__init___loop)selfr __class__ ^/opt/alt/python38/lib/python3.8/site-packages/reactivex/scheduler/eventloop/ioloopscheduler.pyr s
zIOLoopScheduler.__init__)actionstater c sP t ddd fdd}j| ddfdd}tt|S )a! Schedules an action to be executed.
Args:
action: Action to be executed.
state: [Optional] state to be given to the action function.
Returns:
The disposable object used to cancel the scheduled action
(best effort).
FNr c s sj d_d S Nr Z
invoke_actionZ
disposabler r disposedsadr r r r interval5 s z*IOLoopScheduler.schedule.