libmuscle.outbox module

class libmuscle.outbox.Outbox[source]

Bases: object

Stores messages to be sent to a particular receiver.

An Outbox is a queue of messages, which may be deposited and then retrieved in the same order.

deposit(message: bytes) None[source]

Put a message in the Outbox.

The message will be placed at the back of a queue, and may be retrieved later via retrieve().

Parameters:

message – The message to store.

is_empty() bool[source]

Returns True iff the outbox is empty.

retrieve() bytes[source]

Retrieve a message from the Outbox.

The message will be removed from the front of the queue, and returned to the caller. Blocks if the queue is empty, until a message is deposited.

Returns:

The next message.