Registry / async / react-promise-timer

react-promise-timer

JSON →
library1.11.0phppackagistunverified

A trivial implementation of timeouts for Promises, built on top of ReactPHP.

composer require react/promise-timer
INSTALL
IMPORT
SIG · REACT-PROMISE-TIME
R
react-promise-timer
asyncphpv1.11.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TimeoutException
use React\Promise\Timer\TimeoutException;

Add a timeout to an async promise using ReactPHP's event loop.

use React\Promise\Timer; $promise = someAsyncOperation(); $timeout = Timer\timeout($promise, 5.0); $timeout->then(function ($result) { // handle result }, function (\Exception $e) { // handle timeout or error });
Debug
Known issues
gotchaRequires ReactPHP event loop to be running
fix
Ensure you have an event loop running (e.g., Loop::run()).
affects: *
Upgrade
Version history
1.11.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
26
Resources
react-promise-timer — pip install react-promise-timer · libregistry