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

alotsof at gmx.net alotsof at gmx.net
Mon May 30 21:24:02 CEST 2011


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

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 

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

- 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 that look like 
replies to earlier requests, so something got out of step.

Any suggestion?

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

More information about the zeromq-dev mailing list