-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global queue #28
Global queue #28
Conversation
Shiny! I'll run some tests against it tonight 👍 |
Great! I've already successfully run the test suites of react/filesystem, react/react, guzzle and recoil against this branch. But more tests are appreciated! |
Awesome! Going to run test against a specific function's early dev version of https://github.com/WyriHaximus/TickingPromise that was causing segfaults |
Right just had the time to run some tests against it. First off the initial version of The other thing I've noticed that running https://github.com/WyriHaximus/TickingPromise/blob/master/examples/ticking_future.php on the latest tag runs for +/- 24 - 28 seconds while with this PR it runs at 30 seconds solid. Not sure if that is my laptop messing things up maybe you can give it a swirl? Also not that that file is doing 307.200 checks before resolving the promise 😉 . |
Not sure what you're seeing as the "problem" here. That it's slower with the queue (yes, it is slightly slower) or that the time is not longer varying? |
Just presenting my findings as is. Should have clarified that I don't see
them both as a problem. Especially giving the high iteration count.
|
ping @cboden @clue @WyriHaximus |
LGTM 👍 |
This reverts commit cc6f1c3. Note: The task must be kept on the queue until after it is called. Otherwise drain() will be called recursively.
Looks good to me. I'm not sure if my issue belongs here but where would |
@cboden |
What about PromiseTimer...sort of fits the bill...at least requires both as deps. |
Could work, but quickly judging by that package it is focused on promises and timers, not promises queues. Would look out of place imho. |
I don't think it fits into reactphp/promise-timer. If anything, this could become a standalone package as @WyriHaximus suggested. |
I'm planning to add this to 3.0. |
This PR introduces a global task queue to eliminate the problem of deep recursion as discussed in #22.
As noted in this issue, this also opens the possibility to implement future-turn resolutions (#4) through a event loop based queue implementation (example: https://gist.github.com/jsor/52bde3f82014e3898758 for a React\EventLoop based implementation).
Closes #22