U
vi @ s d dl Z d dlZd dlmZ d dlmZmZ d dlmZmZ d dlm Z m
Z
mZ ddlm
Z
edZed ZG d
d de
ZdS ) N)datetime)OptionalTypeVar)abctyping)CompositeDisposable
DisposableSingleAssignmentDisposable )PeriodicScheduler_TStateZRxc s e Zd ZdZejdd fddZdeje e
e ejdddZ
dejeje e
e ejd d
dZdejeje e
e ejd dd
ZeedddZ ZS )AsyncIOSchedulerzA scheduler that schedules work via the asyncio mainloop. This class
does not use the asyncio threadsafe methods, if you need those please use
the AsyncIOThreadSafeScheduler class.N)loopreturnc s t || _dS )zCreate a new AsyncIOScheduler.
Args:
loop: Instance of asyncio event loop to use; typically, you would
get this by asyncio.get_event_loop()
N)super__init___loop)selfr __class__ _/opt/alt/python38/lib/python3.8/site-packages/reactivex/scheduler/eventloop/asyncioscheduler.pyr s
zAsyncIOScheduler.__init__)actionstater c sJ t dd 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).
Nr c s j d_d S Nr Z
invoke_actionZ
disposabler r sadr r r r interval1 s z+AsyncIOScheduler.schedule.