[zeromq-dev] matching REQ-REP on one side with PUB & PULL on the other side

alotsof at gmx.net alotsof at gmx.net
Tue May 31 02:20:12 CEST 2011


Hi,

I've read chapter 1 & 2 of the Guide so far, and some posts in the mailing 
list.

I'm wondering about the following case:

        A client C asks a server S about the status of the workers W(1..n).

(the number of workers can vary)

Here is the implementation I've come up with in terms of communication 
patterns:

        C:REQ -> REP:S 
                S:PUB  -> SUB:W1..Wn
                S:PULL <- PUSH:W1..Wn
        c:REQ <- REP:S 

- C sends a REQ to S
- S sends the status request through PUB to the workers, who have 
subscribed to a 'broadcast' channel.
- the workers send their answers through PUSH-PULL to the server
- the server replies with REP to the client.

My main problem is: how do I figure out whether I have every answer back? 
Or asked differently, is this the right architecture for the problem I 
want to solve?


For now, I count the answers coming in through the PULL socket, and when I 
reach the number of known workers, I wrap up my answer to the client.

It seems to work at first. But later on, I get answers in the server that 
look like replies to earlier requests, so something got out of step.

Any suggestion?

-- 
NEU: FreePhone - kostenlos mobil telefonieren!			
Jetzt informieren: http://www.gmx.net/de/go/freephone



More information about the zeromq-dev mailing list