function Driver::queue
Queue a microtask.
The queued callback MUST be executed immediately once the event loop gains control. Order of queueing MUST be preserved when executing the callbacks. Recursive scheduling can thus result in infinite loops, use with care.
Does NOT create an event callback, thus CAN NOT be marked as disabled or unreferenced. Use {
Parameters
\Closure(...):void $closure The callback to queue.:
mixed ...$args The callback arguments.:
See also
EventLoop::defer()} if you need these features.
2 methods override Driver::queue()
- AbstractDriver::queue in vendor/
revolt/ event-loop/ src/ EventLoop/ Internal/ AbstractDriver.php - Queue a microtask.
- TracingDriver::queue in vendor/
revolt/ event-loop/ src/ EventLoop/ Driver/ TracingDriver.php - Queue a microtask.
File
-
vendor/
revolt/ event-loop/ src/ EventLoop/ Driver.php, line 64
Class
- Driver
- The driver MUST run in its own fiber and execute callbacks in a separate fiber. If fibers are reused, the driver needs to call {
Namespace
Revolt\EventLoopCode
public function queue(\Closure $closure, mixed ...$args) : void;