YAMI4 Python Library 2.0.0
Messaging Solution for Distributed Systems
|
Public Member Functions | |
def | __init__ (self, msg) |
def | __enter__ (self) |
def | __exit__ (self, exc_type, exc_val, exc_tb) |
def | __del__ (self) |
def | close (self) |
def | get_state (self) |
def | wait_for_transmission (self, timeout=0) |
def | wait_for_completion (self, timeout=0) |
def | get_header (self) |
def | get_reply (self) |
def | get_exception_msg (self) |
Static Public Attributes | |
int | POSTED = 1 |
int | TRANSMITTED = 2 |
int | ABANDONED = 3 |
int | REPLIED = 4 |
int | REJECTED = 5 |
Outgoing message. The handler allowing to track the progress of outgoing message, inspect its state and to obtain the reply content. Note: The objects of this class can be safely used from multiple threads.
def yami.OutgoingMessage.close | ( | self | ) |
Deallocates internal resources associated with this object. This function is called automatically if the object is used as a context manager.
def yami.OutgoingMessage.get_exception_msg | ( | self | ) |
Returns the human-readable reason for message rejection.
def yami.OutgoingMessage.get_header | ( | self | ) |
Provides access to the reply header.
def yami.OutgoingMessage.get_reply | ( | self | ) |
Provides access to the reply content.
def yami.OutgoingMessage.get_state | ( | self | ) |
Returns the state of this message. This function allows to inspect the progress of the message transmission and returns a 3-tuple: state, sent and total_byte_count. During transmission the sent value is always smaller than total_byte_count. When these two values become equal, it means that the transmission was either succesful or abandoned.
def yami.OutgoingMessage.wait_for_completion | ( | self, | |
timeout = 0 |
|||
) |
Waits for the full message roundtrip. Waits for the full message roundtrip - that is, for some confirmation that the message has been received and reacted upon by the target agent. If the timeout value is greater than 0, it means relative timeout in milliseconds; the function returns True if the message was completed before the timeout expired and False otherwise. If the timeout value is non-positive, there is no timeout and the function can wait indefinitely. After this function returns True the state of the message is either ABANDONED, REPLIED or REJECTED. Note: This function should not be called if the intended semantics of the message is "one-way" - in this case this function would block indefinitely.
def yami.OutgoingMessage.wait_for_transmission | ( | self, | |
timeout = 0 |
|||
) |
Waits for the transmission to finish. Waits for the transmission to finish - that is, to either send all the message data or to abandon it. If the timeout value is greater than 0, it means relative timeout in milliseconds; the function returns True if the transmission was finished before the timeout expired and False otherwise. If the timeout value is non-positive, there is no timeout and the function can wait indefinitely. After this function returns True the state of the message is either TRANSMITTED, ABANDONED, REPLIED or REJECTED.