U
vit @ 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 )GEventSchedulerz[A scheduler that schedules work via the GEvent event loop.
http://www.gevent.org/
N)geventreturnc s t || _dS )zCreate a new GEventScheduler.
Args:
gevent: The gevent module to use; typically ,you would get this by
import gevent
N)super__init___gevent)selfr __class__ ^/opt/alt/python38/lib/python3.8/site-packages/reactivex/scheduler/eventloop/geventscheduler.pyr s
zGEventScheduler.__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 interval3 s z*GEventScheduler.schedule.