You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know threadsjs has a queue method available on it's Pool class, but I want to create my own queue, in particular I'm writing a persistent queue.
I would like the worker threads to pull from the queue when they are ready/idle for the next task. And this pulling mechanism needs to be blocking to avoid busy-looping on the workers. That is they should just be awaiting on a promise that only resolves when a task is available for dispatch.
What is the right way to do this? Should I be extending the Pool class, or can I make the workers directly pull from some sort of shared queue data structure system?
The text was updated successfully, but these errors were encountered:
I know threadsjs has a queue method available on it's
Pool
class, but I want to create my own queue, in particular I'm writing a persistent queue.I would like the worker threads to pull from the queue when they are ready/idle for the next task. And this pulling mechanism needs to be blocking to avoid busy-looping on the workers. That is they should just be awaiting on a promise that only resolves when a task is available for dispatch.
What is the right way to do this? Should I be extending the
Pool
class, or can I make the workers directly pull from some sort of shared queue data structure system?The text was updated successfully, but these errors were encountered: