blob: d8a7fb5d5b07dc85c16f25d6d89de8e864174abb [file] [log] [blame]
nn_pair - one-to-one scalability protocol
*#include <nanomsg/nn.h>*
*#include <nanomsg/pair.h>*
Pair protocol is the simplest and least scalable scalability protocol. It allows
scaling by breaking the application in exactly two pieces. For example,
if a monolithic application handles both accounting and agenda of HR department,
it can be split into two applications (accounting vs. HR) that are run on two
separate servers. These applications can then communicate via PAIR sockets.
The downside of this protocol is that its scaling properties are very limited.
Splitting the application into two pieces allows to scale the two servers.
To add the third server to the cluster, the application has to be split once
more, say by separating HR functionality into hiring module and salary
computation module. Whenever possible, try to use one of the more scalable
protocols instead.
Socket Types
Socket for communication with exactly one peer. Each party can send messages
at any time. If the peer is not available or send buffer is full subsequent
calls to <<nn_send#,nn_send(3)>> will block until it's possible to send the
Socket Options
No protocol-specific socket options are defined at the moment.
-------[Martin Sustrik]