-
-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
Description
What is the recommended way to wait for a timeout of multiple promises?
react/promise provides several promise collection primitives, which all have valid use cases.
One might assume the following is the way to go:
$promises = array(
accessSomeRemoteResource(),
accessSomeRemoteResource(),
accessSomeRemoteResource()
);
$promise = \React\Promise\all($promises);
Timer\timeout($promise, 10, $loop)->then(function ($values) {
// *all* promises resolved
});How does this cope with cancellation support? (Refs #9 and #3)