-
Notifications
You must be signed in to change notification settings - Fork 86
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
enhance README to include ideal use case(s) #36
Comments
In the case of workerize and greenlet, no pooling is supported. For those use-cases, I'd recommend Clooney since it has built-in strategies for pooling. I'm going to update the readme to point people towards that library for such use-cases. |
Thanks @developit . (FYI - there is a pending issue with |
FWIW, here's an example of pooling with |
Hi @gpolyn - there's some extra stuff going on in that file that you can get rid of when using Workerize. Here's a modified version: Perk: you can just call your exported functions on the pool, no need for the import Worker from 'workerize-loader!./worker';
import WorkerPool from './worker-pool';
let pool = new WorkerPool(Worker, 4);
for (let i=10; i--; ) pool.doThing(); |
@developit thanks a lot! Your mod revised at line 33: https://gist.github.com/gpolyn/9a2ced1e6f4f12375f7430cfcc2ba6b6 |
Good catch, I updated. |
I came to
workerize-loader
for ease-of-use, but now I wonder about about pooling-type issues imposed by my present need for overlapping tasks.So, I hope this is a helpful suggestion: Clarify use case in
README
, e.g.,greenlet
<workerize-loader
<workerpool
.For example, does the following feature imply a 'natural' way to limit the number of workers?
If exported module methods are already async, signature is unchanged
The text was updated successfully, but these errors were encountered: