Timer
Eventlet Timer.
Attributes
| Attribute | Type | Description |
|---|---|---|
| GreenletExit | exception class | Reference to the GreenletExit exception class used to handle greenlet termination during timer execution. |
| _spawn_after | callable | The eventlet greenlet spawning function used to schedule delayed execution of timer entries. |
| _queue | set | A set containing active greenlet instances representing scheduled timer events. |
| queue | set | Provides access to the internal set of scheduled greenlet timer entries. |
Constructor
Signature
def Timer(
*args: any,
**kwargs: any
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| *args | any | Variable length argument list passed to the parent timer class. |
| **kwargs | any | Arbitrary 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
| Name | Type | Description |
|---|---|---|
| tref | greenlet | The 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
| Type | Description |
|---|---|
set | A set containing the greenlet objects currently managed by the timer. |