function EventLoop::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.
File
-
vendor/
revolt/ event-loop/ src/ EventLoop.php, line 82
Class
- EventLoop
- Accessor to allow global access to the event loop.
Namespace
RevoltCode
public static function queue(\Closure $closure, mixed ...$args) : void {
self::getDriver()->queue($closure, ...$args);
}