Amp\Delayed class Delayed implements Amp\Promise

Creates a promise that resolves itself with a given value after a number of milliseconds.

Summary

Properties

Methods

Properties

Methods

__construct — public function __construct(int $time, mixed $value = null)
No documentation.
Type Parameter Description Default Value
int $time Milliseconds before succeeding the promise. none
mixed $value Succeed the promise with this value. null
reference — public function reference()

References the internal watcher in the event loop, keeping the loop running while this promise is pending.

unreference — public function unreference()

Unreferences the internal watcher in the event loop, allowing the loop to stop while this promise is pending if no other events are pending in the loop.

onResolve — public function onResolve(callable $onResolved)
No documentation.
Type Parameter Description Default Value
callable $onResolved No documentation. none