YAMI4 Python Library 2.0.0
Messaging Solution for Distributed Systems
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
yami.OutgoingMessage Class Reference
Inheritance diagram for yami.OutgoingMessage:

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
 

Detailed Description

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.

Member Function Documentation

◆ close()

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.

◆ get_exception_msg()

def yami.OutgoingMessage.get_exception_msg (   self)
Returns the human-readable reason for message rejection.

◆ get_header()

def yami.OutgoingMessage.get_header (   self)
Provides access to the reply header.

◆ get_reply()

def yami.OutgoingMessage.get_reply (   self)
Provides access to the reply content.

◆ get_state()

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.

◆ wait_for_completion()

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.

◆ wait_for_transmission()

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.

The documentation for this class was generated from the following file: