Skip to content

message_store_base

messageflux.iodevices.message_store_device_wrapper.message_store_base

MessageStoreBase

base class for a Message Store

magic abstractmethod property

magic

return a magic prefix that is unique and constant for this message store

__enter__

__enter__()

enters the context for this Message Store

Returns:

Type Description
MessageStoreBase

self

__exit__

__exit__(exc_type, exc_val, exc_tb)

exits the context for this Message Store (calls close)

Parameters:

Name Type Description Default
exc_type
required
exc_val
required
exc_tb
required

connect

connect()

connects to Message Store

It is expected, that the implementation stays connected to the message store since 'connect' is called, and up until 'close' is called.

if the for some reason the connection terminates, the implementation must try to re-connect silently upon operation

delete_message abstractmethod

delete_message(key)

deletes a message from the message store

Parameters:

Name Type Description Default
key str

the key to the message

required

delete_messages

delete_messages(keys)

deletes multiple messages from the message store

Parameters:

Name Type Description Default
keys list[str]

the list of keys to the messages

required

disconnect

disconnect()

closes the connection to Message Store

put_message abstractmethod

put_message(device_name, message_bundle)

puts a message in the message store

Parameters:

Name Type Description Default
device_name str

the name of the device putting the item in the store

required
message_bundle MessageBundle

the Message bundle to write to the store

required

Returns:

Type Description
str

the key to the message in the message store

read_message abstractmethod

read_message(key)

reads a message according to the key given

Parameters:

Name Type Description Default
key str

the key to the message

required

Returns:

Type Description
MessageBundle

a Message from the store

MessageStoreException

MessageStoreException(
    *args, inner_exceptions=None, **kwargs
)

Bases: AggregatedException

base exception for message store exceptions