in_memory

class mersal.outbox.in_memory.InMemoryOutboxStorage[source]

Bases: OutboxStorage

__init__() None[source]
async get_next_message_batch() OutboxMessageBatch[source]

Provide messages stored in the outbox.

async save(outgoing_messages: Sequence[OutgoingMessage], transaction_context: TransactionContext) None[source]

Save outbox messages.

The TransactionContext can be used to obtain objects related to the current message being handled. For example, to obtain the database transaction/session.

Parameters:
  • outgoing_messages – A list of messages to be stored in the outbox.

  • transaction_context – The TransactionContext for the message that is currently being handled.