Class: Synapse::EventSourcing::CachingEventSourcingRepository

Inherits:
EventSourcingRepository show all
Defined in:
lib/synapse/event_sourcing/caching.rb

Overview

Implementation of an event sourcing repository that uses a cache to improve performance when loading aggregates

Caching is not compatible with optimistic locking

Note that if an error occurs while saving an aggregate, it will be invalidated from the cache to prevent aggregates being returned from the cache that were not fully persisted to disk.

Instance Attribute Summary collapse

Attributes inherited from EventSourcingRepository

#aggregate_factory, #conflict_resolver, #event_store, #snapshot_policy, #snapshot_taker, #stream_decorators

Attributes inherited from Repository::LockingRepository

#lock_manager

Method Summary

Methods inherited from EventSourcingRepository

#initialize

Methods inherited from Repository::LockingRepository

#add, #initialize, #load

Constructor Details

This class inherits a constructor from Synapse::EventSourcing::EventSourcingRepository

Instance Attribute Details

#cacheActiveSupport::Cache::Store

Returns:

  • (ActiveSupport::Cache::Store)


12
13
14
# File 'lib/synapse/event_sourcing/caching.rb', line 12

def cache
  @cache
end