[nanomsg] Re: Asynchronous REPREQ

  • From: Dirkjan Ochtman <dirkjan@xxxxxxxxxx>
  • To: nanomsg <nanomsg@xxxxxxxxxxxxx>
  • Date: Wed, 5 Feb 2014 08:59:25 +0100

On Tue, Feb 4, 2014 at 10:53 PM, Bradley Volen <bradvolen@xxxxxxxxx> wrote:
> I have looked through the archives and have seen this come up multiple
> times, but I haven't seen any concrete answer to this. How can I have a
> single worker thread process multiple requests (from the same or different
> clients) simultaneously.

I think I'd build something like this with different socket types. I
think PUSH/PULL sockets are better for this, where your worker thread
opens up a PULL socket to receive requests, and clients submit an
identification for themselves along with the request. The worker also
opens a PUB socket, and pushes out responses prefixed with the client
ID, so that the clients can subscribe to the responses and filter out
everything that isn't interesting to them.

Cheers,

Dirkjan

Other related posts: