The elegance of ZeroMQ messaging is that it provides easy scalability. The API for 0MQ sockets is the same whether you are doing in-process (inter thread) communication, inter-process communication, peer-to-peer network communication or multicast communication.
As long as you are putting data and not pointers in your messages (*cough* Async::Worker *cough*), you convert your code from in-process communication to cross-network with a one line change:
// Create the socket: same code in either case. zmq::socket_t outSocket(zmqContext, ZMQ_REP) ; ... outSocket.connect("in-proc://my-connection") ; // becomes outSocket.connect("tcp://192.168.0.65:2342") ;
and voila – your application is networking instead of talking to itself.
They also provide three external utilities that make it a doddle to scale your application across multiple machines.