Bases: object
A Message class for non-copy send/recvs.
This class is only needed if you want to do non-copying send and recvs. When you pass a string to this class, like Message(s), the ref-count of s is increased by two: once because the Message saves s as an instance attribute and another because a ZMQ message is created that points to the buffer of s. This second ref-count increase makes sure that s lives until all messages that use it have been sent. Once 0MQ sends all the messages and it doesn’t need the buffer of s, 0MQ will call Py_DECREF(s).
Parameters : | data : object, optional
track : bool [default: False]
|
---|
Get a read-only buffer view of the message contents.
Get the message content as a Python str/bytes object.
The first time this property is accessed, a copy of the message contents is made. From then on that same copy of the message is returned.
Is 0MQ completely done with the message?
Wait for 0MQ to be done with the message, or until timeout.
Parameters : | timeout : float [default: -1, wait forever]
|
---|---|
Returns : | None :
|
Raises : | NotDone :
|
Bases: object
A class for tracking if 0MQ is done using one or more messages.
When you send a 0MQ mesage, it is not sent immeidately. The 0MQ IO thread send the message at some later time. Often you want to know when 0MQ has actually sent the message though. This is complicated by the fact that a single 0MQ message can be sent multiple times using differen sockets. This class allows you to track all of the 0MQ usages of a message.
Parameters : | *towatch : tuple of Queue, MessageTracker, Message instances.
|
---|
Is 0MQ completely done with the message(s) being tracked?
If the new wait works, remove this method.
Wait for 0MQ to be done with the message, or until timeout.
Parameters : | timeout : float [default: -1, wait forever]
|
---|---|
Returns : | None :
|
Raises : | NotDone :
|