I'll paste my response from IRC here since it is relevant and I'll add a few more thoughts.
cremes:cosmoharrigan_: how is the response sent back via the callback? If it's via that single DEALER socket and the callback runs in another thread, you need to protect the socket with a mutex. [3:46pm]cremes:Best to just give each thread its own socket. It's a cleaner design plus it let's you push thread & lock management into zeromq. If the reply from the callback needs to be routed back to the client, you should continue to use DEALER(client) <-> ROUTER (broker) <-> DEALER (worker). In this case there is a single worker but the message passing works exactly the same. cr On Nov 6, 2013, at 3:43 PM, Cosmo Harrigan <[email protected]> wrote: > Hi, > > I want to implement a design similar to the Request-Reply Broker from the > zguide (https://raw.github.com/imatix/zguide/master/images/fig17.png) but > instead of having multiple workers running ahead of time, I want to have one > worker that receives all the requests, and spawns asynchronous operations > (tasks) to handle them and send the responses. > > What would be the proper combination of socket types to achieve this? > > Thanks, > Cosmo Harrigan > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
