[zeromq-dev] Unknown number of workers???

Dmitry Nikiforov dniq at dniq-online.com
Wed Mar 14 19:35:37 CET 2012

So what if I don't know how many workers there are? I'v'e tried to have the workers open ZMQ_REQ sockets to boss, and it works fine on Mac OS X, where workers block on "send" until the boss is up and alive. But on Linux the "send" doesn't block, even if the boss does not exist yet (and no error returned either), so this approach does not work.

For now I made every worker register in MySQL database, and boss gets the list from MySQL and opens connection to every worker, but this is not perfect: currently workers can't join or leave in the middle of the task. Well, they can leave, but that'd be bad.

Can anybody offer any ideas on how to best implement this?

Regards - Dmitry

More information about the zeromq-dev mailing list