4 ms·
> This could probably be improved by having a background thread that uses a ZeroMQ socket for heartbeating. Don't use heartbeats on REQ/REP, because they won't
by m0th87 14y ago
> This could probably be improved by having a background thread that uses a ZeroMQ socket for heartbeating.
Don't use heartbeats on REQ/REP, because they won't work well with the lockstep communication fashion of those socket types. Also, you have to be careful because ZeroMQ sockets are not thread-safe, so the background and active thread must coordinate through a lock, or work in an implementation that handles this implicitly for you.
In ZeroRPC, we solve this by using XREQ/XREP with heartbeats. This has worked out pretty well in practice.