persistence¶
- class mersal.persistence.in_memory.InMemoryMessageTracker¶
Bases:
MessageTracker
Tracks handled messages in memory.
- async is_message_tracked(message_id: UUID, transaction_context: TransactionContext) bool ¶
Check if message identified by message_id is handled.
- async track_message(message_id: UUID, transaction_context: TransactionContext) None ¶
Set message identified by message_id as handled.
- class mersal.persistence.in_memory.InMemorySubscriptionStorage¶
Bases:
SubscriptionStorage
In memory implementation for storing topics subscriptions.
- async get_subscriber_addresses(topic: str) set[str] ¶
Get addresses subscribed for the given topic.
- Parameters:
topic – topic name to get the addresses for.
- Returns:
A set of addresses subscribed to this topic.
- property is_centralized: bool¶
Whether this storage is centralized.
Centralized storage means topic subscriptions are stored in one place and registration/unregistration can be done by directly calling register_subscriber and unregister_subscriber, respectively.
Non centralized means each topic handles its own storage and registration/unregistration is performed by sending a message to the topic owner (async).
- class mersal.persistence.in_memory.InMemorySubscriptionStore¶
Bases:
defaultdict
[str
,MutableSet
[str
]]