You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To expand on the previous comment, we might also consider if we should reduce our API to a single await() method can leave the remaining functional to the user instead.
await($promise, $loop);
It's sufficiently easy to call the following functions yourself:
Arguably, the $loop argument makes this a bit hard to read. Once "singularity" landed (see also first comment), the resulting call might look like this:
await(Timeout\await($promise, $time));
Similarly, this also applies to slightly more complicated combinations:
Activity
clue commentedon Jul 2, 2015
Some random thoughts:
$loopargument could eventually become obsolete (i.e. optional) once React singularity is being considered.Blockeris hardly useful, so I'm not really seeing any benefit whatsoeverclue commentedon Jul 2, 2015
Also, regarding functional composition: Quite a bit of the current API can probably be replaced with a somewhat simpler functional approach.
For example, the
awaitAll($promises)method (currently 50+ lines) could be expressed like this:(Though this skips cancellation for now, see also #4)
To be clear: I'm not saying this can not be done with our current OOP API, but the functional API certainly makes this more obvious.
clue commentedon Jul 2, 2015
To expand on the previous comment, we might also consider if we should reduce our API to a single
await()method can leave the remaining functional to the user instead.It's sufficiently easy to call the following functions yourself:
awaitAll():awaitRace()(see also #6 for some background):wait()(see also https://github.com/clue/php-promise-timeout):clue commentedon Jul 2, 2015
Also, combined with https://github.com/clue/php-promise-timeout, it's pretty easy to add timeout support to any of the above (see also #2):
Arguably, the
$loopargument makes this a bit hard to read. Once "singularity" landed (see also first comment), the resulting call might look like this:Similarly, this also applies to slightly more complicated combinations: