josdejong / workerpool

Offload tasks to a pool of workers on node.js and in the browser
Apache License 2.0
2.07k stars 146 forks source link

Feature enhancement: Adding Pool.broadcast() for sending some data to all child workers #185

Open stainleebakhla opened 4 years ago

stainleebakhla commented 4 years ago

Hi,

It would be a useful feature if there could be a way to send some data to all of the child workers in a pool. Something like Pool.broadcast() function would work. This could be really useful in scenarios when some initial data needs to be sent to a worker before starting any actual work.

Thanks

josdejong commented 4 years ago

Thanks for your suggestion Stainlee.

I think your idea is similar to what is discussed in #65. If so let's please continue the discussion there.

frankie-zeng commented 1 year ago

is there a plan to use worker_thread broadcastchannel, which make all worker recevie a broadcast message and do some actions.

josdejong commented 1 year ago

I'm open to pull requests implementing this (see also #65).