An ØMQ Context where ØMQ sockets live within.
Each ØMQ socket lives within a specific context. Creating and
destroying context is a counterpart of library
initialisation/deinitialisation as used elsewhere. Ability to create
multiple contexts saves the day when an application happens to
link (indirectly and involuntarily) with several instances of 0MQ.
Implementation notes: the fact that ØMQ can work in a threaded
enviroment is currently hidden by this Liberty wrappers
TODO: add support for pollability (ZMQ_POLL)
Action to be executed just before garbage collection reclaims an
object.
Comparison and copying
Since a ZMQ_CONTEXT is entirely opaque object they are not
distinguishable so is_equal is always True. Copying just create another
context.
Request-reply pattern
The request-reply pattern is used for sending requests from a client to
one or more instances of a service, and receiving subsequent replies to
each request sent.
A new ZMQ_REP socket to receive requests from and send replies to a client.
Publish-subscribe pattern
The publish-subscribe pattern is used for one-to-many distribution of
data from a single publisher to multiple subscribers in a fan out
fashion.
A new ZMQ_SUB_SOCKET used by a subscriber to subscribe to data
distributed by a publisher.
Pipeline pattern
The pipeline pattern is used for distributing data to nodes arranged in
a pipeline. Data always flows down the pipeline, and each stage of the
pipeline is connected to at least one node. When a pipeline stage
connected to multiple nodes data is load-balanced among all connected
nodes.
Build a FAST_ARRAY of STRINGs from a_pointer which must be of a
NULL-terminated array of C strings, that is a "char**" String
contents and array itself are copied.
A new ZMQ_REQ_SOCKET, that sends requests to and receives replies from a service.
This socket type allows only an alternating sequence of request -
sending a message - and subsequent reply - receiving an answer. Each
request sent is load-balanced among all services, and each reply
received is matched with the last issued request.
A new ZMQ_REP socket to receive requests from and send replies to a client.
It allows only an alternating sequence of request (receive) and
subsequent reply (send) commands. Each request received
fair-queued from among all clients, and each reply sent is routed to
the client that issued the last request. If the original requester
doesn’t exist any more the reply is silently discarded.
A new ZMQ_PUB_SOCKET, used by a publisher to distribute data.
Messages sent are distributed in a fan out fashion to all connected
peers.
When a ZMQ_PUB_SOCKET enters an exceptional state due to having
reached the high water mark for a subscriber, then any messages that
would be sent to the subscriber in question shall instead be dropped
until the exceptional state ends. The send command shall never
block for this socket type.
A new ZMQ_SUB_SOCKET used by a subscriber to subscribe to data
distributed by a publisher.
Initially this socket is not subscribed
to any messages, use subscribe_to or subscribe_to_all to specify
which messages to subscribe to. This is a receiving only socket.
A new socket used in a pipeline node to send messages to downstream
pipeline nodes.
Messages are load-balanced to all connected
downstream nodes.
When a ZMQ_PUSH_SOCKET enters an exceptional state due to having
reached the high water mark for all downstream nodes, or if there
are no downstream nodes at all, then any send operations on the
socket shall block until the exceptional state ends or at least one
downstream node becomes available for sending; messages are not
discarded.
Summary of ZMQ_PUSH characteristics
Compatible peer sockets ZMQ_PULL
Direction Unidirectional
Send/receive pattern Send only
Incoming routing strategy N/A
Outgoing routing strategy Load-balanced
ZMQ_HWM option action Block
ZMQ_PULL
A socket of type ZMQ_PULL is used by a pipeline node to receive messages from upstream
pipeline nodes.
Messages are fair-queued from among all connected upstream nodes. The
zmq_send() function is not implemented for this socket type.
Deprecated alias: ZMQ_UPSTREAM.
Table 8. Summary of ZMQ_PULL characteristics
Compatible peer sockets ZMQ_PUSH
Direction Unidirectional
Send/receive pattern Receive only
Incoming routing strategy Fair-queued
Outgoing routing strategy N/A
ZMQ_HWM option action N/A
This exception occurs when Void is passed as the expression
to inspect ("inspect on STRING only).
This exception also occurs when the inspected value selects no branch (when the keyword "else"
not used, one "when" branch _must_ be selected). Some value which is not one of the inspect
constants, if there is no Else_part
Build a FAST_ARRAY of STRINGs from a_pointer which must be of a
NULL-terminated array of C strings, that is a "char**" String
contents and array itself are copied.