Closed kurtextrem closed 6 years ago
As an option maybe! Or another function that wraps Greenlet
Hi there, I wanted to work on this issue and was just wondering that, is the requirement like there would be N workers created for N different tasks, and for N + 1 task in a round robin fashion allocate to one of the previous N's which have finished. So at a time only N workers.
Or like N workers for one task? If you could help me out with understanding context may be I can try to implement.
@bishwenduk029 I leave that to @developit, however I think it's the first case as I think the most common use case is one task = one worker instead of computing something over N workers.
Definitely N workers for one task, with round-robin routing. Personally I'd love to see a pool size parameter (either as a cap or initially allocated, perhaps as an option).
Here's a pooling solution: https://gist.github.com/developit/65a2212731f6b00a8aaa55d70c594f5c
Wouldn't it be beneficial to create N workers, where N is the amount of CPU cores the system has, instead of only one?