Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Driver.php

function Driver::defer

Defer the execution of a callback.

The deferred callback MUST be executed before any other type of callback in a tick. Order of enabling MUST be preserved when executing the callbacks.

The created callback MUST immediately be marked as enabled, but only be activated (i.e. callback can be called) right before the next tick. Callbacks MUST NOT be called in the tick they were enabled.

Parameters

\Closure(string):void $closure The callback to defer. The `$callbackId` will be invalidated before the: callback invocation.

Return value

string A unique identifier that can be used to cancel, enable or disable the callback.

2 methods override Driver::defer()
AbstractDriver::defer in vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php
Defer the execution of a callback.
TracingDriver::defer in vendor/revolt/event-loop/src/EventLoop/Driver/TracingDriver.php
Defer the execution of a callback.

File

vendor/revolt/event-loop/src/EventLoop/Driver.php, line 80

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\EventLoop

Code

public function defer(\Closure $closure) : string;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal