[zeromq-dev] clone pattern Q: ok to replace by XPUB?

Michael Haberler mail17 at mah.priv.at
Tue Feb 18 13:39:51 CET 2014


The clone pattern is close to what I need for state replication. There's one simplification I plan to use (assuming clone was written before XPUB was around):

as per guide, clone uses PUB(server)/SUB(client) for distribution of a subtree, and DEALER(client)/ROUTER(server) for client state request.

I use an XPUB(server)/SUB(client) and notify the server of a state request by client subscribe of the subtree name

the way XPUB stands, the server will get a \001<subtree> message for each subscriber, and a single \000<subtree> message on last client unsubscribing; that's exactly what's needed for managing the state replication on demand (it wont get a message for _each_ unsubscribe, but that's ok).

One socket less to manage, same effect. Are these patterns equivalent or am I overlooking something?

- Michael









More information about the zeromq-dev mailing list