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

Breadcrumb

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

function EventLoop::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. Deferred 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.

File

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

Class

EventLoop
Accessor to allow global access to the event loop.

Namespace

Revolt

Code

public static function defer(\Closure $closure) : string {
    return self::getDriver()->defer($closure);
}

API Navigation

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