Sourcing::Plugin::EventStore::Memory
In-memory implementation of the EventStore interface. Suitable for testing and development.
Overview
This class implements Sourcing::Plugin::EventStore using in-memory storage. Events are stored in an array and emitted through a Supply. It also includes state caching methods for complete plugin functionality.
Notes
- Events are stored in memory and lost when the process exits
- Optimistic locking is supported via CAS (compare-and-swap) operations
- For production, implement your own EventStore using a persistent database
See Also
- Sourcing::Plugin::EventStore — the abstract interface
- Sourcing::Plugin::Memory — combined backward-compatible implementation
- Writing a Plugin Guide — how to implement your own plugin