Patterns

These are the most basic socket patterns in libzmq.

Client-Server

The Client-Server pattern is a advanced asynchronous request-reply pattern.

The Server receives messages with a unique RoutingId associated with a Client. This RoutingId can be used by the Server to route replies to the Client.

       <───> client
server <───> client
       <───> client

The Client socket receives upstream messages in a fair-queued fashion

server ─┐
server ────> client
server ─┘

Radio-Dish

The Radio-Dish pattern is an asynchronous publish-subscribe pattern.

The Radio socket send messages in a fan-out fashion to all Dish that joined the message's Group.

      ────> dish
radio ────> dish
      ────> dish

The Dish socket receive messages from Group it has joined in a fair-queued fashion.

radio ─┐
radio ────> dish
radio ─┘

Scatter-Gather

The Scatter-Gather pattern is an asynchronous pipeline pattern.

The Scatter socket send messages downstream in a round-robin fashion

         ┌──> gather
scatter ────> gather
         └──> gather

The Gather socket receives upstream messages in a fair-queued fashion

scatter ─┐
scatter ───> gather
scatter ─┘