Skip to content

Data structures

depeche_db.MessageProtocol

Bases: Protocol

Message protocol is a base class for all messages that are used in the system.

get_message_id()

Returns message ID

get_message_time()

Returns message time


depeche_db.MessagePosition dataclass

Message position is a position of the message in the stream.

Attributes:

Name Type Description
stream str

Stream name

version int

Message version

global_position int

Global position


depeche_db.StoredMessage dataclass

Bases: Generic[E]

Stored message is a message that is stored in the stream.

Attributes:

Name Type Description
message_id UUID

Message ID

stream str

Stream name

version int

Message version

message E

Message (E subtype of MessageProtocol)

global_position int

Global position


depeche_db.SubscriptionMessage dataclass

Bases: Generic[E]

Subscription message is a message that is received from the subscription.

Attributes:

Name Type Description
partition int

Partition number

position int

Position in the partition

stored_message StoredMessage[E]

Stored message (E subtype of MessageProtocol)


depeche_db.SubscriptionState dataclass

Subscription state is a state of the subscription.

Attributes:

Name Type Description
positions Dict[int, int]

Mapping of partition number to the position in the partition