Skip to main content

Timer

Eventlet Timer.

Attributes​

AttributeTypeDescription
GreenletExitexception classReference to the GreenletExit exception class used to handle greenlet termination during timer execution.
_spawn_aftercallableThe eventlet greenlet spawning function used to schedule delayed execution of timer entries.
_queuesetA set containing active greenlet instances representing scheduled timer events.
queuesetProvides access to the internal set of scheduled greenlet timer entries.

Constructor​

Signature​

def Timer(
*args: any,
**kwargs: any
) - > null

Parameters​

NameTypeDescription
*argsanyVariable length argument list passed to the parent timer class.
**kwargsanyArbitrary keyword arguments passed to the parent timer class.

Methods​


clear()​

@classmethod
def clear()

Cancels all currently scheduled tasks and empties the internal tracking queue.


cancel()​

@classmethod
def cancel(
tref: greenlet
)

Cancels a specific scheduled task referenced by its greenlet handle.

Parameters​

NameTypeDescription
trefgreenletThe reference to the greenlet task that should be aborted.

queue()​

@classmethod
def queue() - > set

Provides access to the set of currently active and scheduled greenlet tasks.

Returns​

TypeDescription
setA set containing the greenlet objects currently managed by the timer.