richardmillen / zguide-examples

Implementations of the 0MQ examples in the guide.
http://zguide.zeromq.org/page:all
4 stars 0 forks source link

Dealing with Blocked Peers in C++ #39

Open richardmillen opened 7 years ago

richardmillen commented 7 years ago

Implement the Dealing with Blocked Peers example.

In any performance-sensitive ZeroMQ architecture, you need to solve the problem of flow control. You cannot simply send unlimited messages to a socket and hope for the best. At the one extreme, you can exhaust memory. This is a classic failure pattern for a message broker: one slow client stops receiving messages; the broker starts to queue them, and eventually exhausts memory and the whole process dies. At the other extreme, the socket drops messages, or blocks, as you hit the high-water mark.