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

Breadcrumb

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

function EventLoop::delay

Delay the execution of a callback.

The delay is a minimum and approximate, accuracy is not guaranteed. Order of calls MUST be determined by which timers expire first, but timers with the same expiration time MAY be executed in any order.

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

float $delay The amount of time, in seconds, to delay the execution for.:

\Closure(string):void $closure The callback to delay. 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 121

Class

EventLoop
Accessor to allow global access to the event loop.

Namespace

Revolt

Code

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

API Navigation

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