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
Resolving promises within workers #212
Comments
I am not sure whether I fully understand your question or not. Basically, the logic provided as a parameter of map is your code. That part will be executed in the separate process or thread. Once your logic finishes execution, the result returned will be wrapped into a message and delivered to the parent process/thread. The parent process/thread is waiting for some resolved result from the child, not a promise or a group of promises. So, you'd better write some code to wait for all promises getting resolved in the child side, and then return the final resolved result to the parent. It looks like that's how parallel.js works. There is a new launched peoject "jsworkers" (inheriting code and all features from parallel.js, and supporting more handy additions). But you are supposed to have the same issue if you want to give it a try. https://github.com/brucecan/jsworkers |
The text was updated successfully, but these errors were encountered: