taskforcesh / bullmq

BullMQ - Message Queue and Batch processing for NodeJS and Python based on Redis
https://bullmq.io
MIT License
6.09k stars 399 forks source link

Reference to child process for IPC #275

Open ferbs opened 4 years ago

ferbs commented 4 years ago

It doesn't look like bullmq v1.9.0 exposes child processes running sandboxed jobs. One use case for IPC between the parent proces and sandboxed jobs is the request-response pattern, where a sandboxed job adds a new response job upon finishing, relaying the result over IPC to be enqueued rather than creating a Queue/connection in each child process or using some more awkward messaging mechanism. Another use case is a child asking the parent for auxiliary job data, such as a long-delayed job fetching a time-sensitive auth token.

Feature request? Perhaps worker.childPool could emit a message on start/stop with a ref to the child process.

manast commented 4 years ago

sounds like two interesting use-cases. Considering this should be a pretty simple feature I think we should keep it as a feature request.

ferbs commented 4 years ago

Great! I dropped a loopback-only http server into my project as a messaging placeholder but can contribute this feature later (in some weeks/months) if no one on your team has the need or time for it.