-
Notifications
You must be signed in to change notification settings - Fork 6
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
alternative to galaxy.spin() #12
Comments
That's a cool idea. I'm not sure it is that easy to implement but I'll investigate. In the mean time, you can solve this with
The |
I gave it a try as it seemed rather easy to implement (and not risky because an exception was thrown in this case). This is really a cool idea 😄 If it works (you can try by pulling from git) I'll publish to NPM but I need to write a few unit tests first. |
Awesome! Thanks so much :) |
I'll need to improve it because it does not return immediately if an operation throws an error. For example, if the first operation succeeds after 1000 ms and the second one fails after 500 ms, it will fail after 1000 ms. But that won't impact the syntax. |
Yeah, that would be important. Is that difficult to implement? |
Not, it is not really hard but I won't have time today (I have a job). |
Of course. No hurry :) |
When I want to execute three functions in parallel, AFAIK I have to to use
forEachStar
(which I don't fully understand yet due to lack of documentation) or write something like this:Instead, couldn't you allow to pass an array to
yield
with all generators that must complete in parallel?That would be much shorter.
I'd also expect that yield would return immediately should one of the operations throw an error.
Also, if the results of these generators are required, give them back as an array:
What do you think?
PS: Compliments, great work! This is the solution I like the most (to simulate synchroneous programming).
The text was updated successfully, but these errors were encountered: