InMemoryBackend
Bases: TransactionalBackend
In-memory backend for Event Sourcery.
Provides a fully configured backend for in-memory event store.
Useful for testing, development, and scenarios where persistence is not required. Ensures multi-tenancy and transactional event handling using in-memory implementations.
Source code in event_sourcery/_event_store/in_memory.py
configure(config=None)
Sets the backend configuration for outbox behavior.
If no config is provided, the default configuration is used. This method must be called before using the backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
InMemoryConfig | None
|
Optional custom configuration. If None, uses default KurrentDBConfig(). |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Self |
Self
|
The configured backend instance (for chaining). |
Source code in event_sourcery/_event_store/in_memory.py
InMemoryConfig
Bases: BaseModel
Configuration for InMemoryBackend event store integration.
Attributes:
| Name | Type | Description |
|---|---|---|
outbox_attempts |
PositiveInt
|
Maximum number of outbox delivery attempts per event before giving up. |
Source code in event_sourcery/_event_store/in_memory.py
InMemoryKeyStorage
Bases: EncryptionKeyStorageStrategy
In-memory implementation of encryption key storage strategy.
Stores encryption keys for data subjects in memory. Suitable for testing and development where persistent key storage is not required.