eventletDrainer
This class provides a concrete implementation of a greenlet drainer specifically designed for the Eventlet concurrency library. It handles the spawning of greenlets and manages synchronization using Eventlet-adapted event primitives. The class ensures that newly spawned tasks are immediately scheduled by yielding control back to the event loop.
Methods
spawn()
@classmethod
def spawn(
func: callable
) - > GreenThread
Executes a function in a new eventlet green thread and yields control to the scheduler to allow the greenlet to start immediately.
Parameters
| Name | Type | Description |
|---|---|---|
| func | callable | The function or callable to be executed asynchronously within the eventlet greenlet. |
Returns
| Type | Description |
|---|---|
GreenThread | The eventlet GreenThread object representing the newly spawned execution context. |