promises
promises copied to clipboard
Promises/A+ library for PHP with synchronous support
In the Callbacks section, there are grammatical errors, in the last paragraph, which is just below the code snippet. The sentence is written as, "Resolving a promise means that you...
In the Callbacks section, there are grammatical errors, in the last paragraph, which is just below the code snippet. The sentence is written as, "Resolving a promise means that you...
**Description** Does it make sense to add `$config` as a third optional parameter to `Utils::all`, so that callers have more control over the underlying EachPromise (like `concurrency`)? **Example** Current code:...
It suggests the following as event loop integration for ReactPHP: ```php $loop = React\EventLoop\Factory::create(); $loop->addPeriodicTimer(0, [$queue, 'run']); ``` That will basically be an infinite loop that always calls `[$queue, 'run']`...
In general, if a promise's `getState()` returns `FULFILLED` or `REJECTED`, then `wait()` returns a value or error immediately. (i.e., you can call `inspect()` on a non-pending promise and get a...
The code works if i do $promise->wait();, however i am not sure how can i call the promise to work async. ``` foreach ($entries as $key=>$value) { $promise = new...
I don't really understand can I implement producer-consumer scheme using this library? For example, imagine a producing function which makes some values over time, and another consuming function which takes...
the thenable cannot omit the value for resolve(). ``` PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function GuzzleHttp\Promise\Promise::resolve(), 0 passed ``` but it's very useful for just resolve...
I was just writing some code that would have been greatly improved by having a `splat()` function that works similarly to `all()`. The current code is: ``` php Promise\all($promises)->then(function ($results)...
See https://github.com/reactphp/promise/issues/66 please I need `guzzlehttp/promises` implements `done()` https://github.com/reactphp/promise#done-vs-then