Class: Synapse::Configuration::AggregateSnapshotTakerDefinitionBuilder

Inherits:
DefinitionBuilder
  • Object
show all
Defined in:
lib/synapse/configuration/component/event_sourcing/snapshot/aggregate_taker.rb

Overview

Definition builder used to create aggregate snapshot takers

Examples:

The minimum possible effort to build an aggregate snapshot taker

snapshot_taker

Build an aggregate snapshot taker using an alternate event store and factory tag

snapshot_taker :alt_snapshot_taker do
  use_aggregate_factory_tag :alt_factory_tag
  use_event_store :alt_event_store
end

Instance Attribute Summary

Attributes inherited from DefinitionBuilder

#id

Instance Method Summary collapse

Methods inherited from DefinitionBuilder

#anonymous, #as_prototype, #as_singleton, build, #build_composite, #build_definition, #clear_tags, #identified_by, #initialize, #register_definition, #replace_tags, #tag, #use_factory, #use_instance

Constructor Details

This class inherits a constructor from Synapse::Configuration::DefinitionBuilder

Instance Method Details

#use_aggregate_factory_tag(aggregate_factory_tag) ⇒ undefined

Changes the tag used to find aggregate factories necessary for creating aggregates so that a snapshot can be taken of their current state

Parameters:

  • aggregate_factory_tag (Symbol)

Returns:

  • (undefined)

See Also:



20
21
22
# File 'lib/synapse/configuration/component/event_sourcing/snapshot/aggregate_taker.rb', line 20

def use_aggregate_factory_tag(aggregate_factory_tag)
  @aggregate_factory_tag = aggregate_factory_tag
end

#use_event_store(event_store) ⇒ undefined

Changes the event store used to load and store aggregates

Parameters:

  • event_store (Symbol)

Returns:

  • (undefined)

See Also:



29
30
31
# File 'lib/synapse/configuration/component/event_sourcing/snapshot/aggregate_taker.rb', line 29

def use_event_store(event_store)
  @event_store = event_store
end