Class: Synapse::Configuration::MongoEventStoreDefinitionBuilder
- Inherits:
-
DefinitionBuilder
- Object
- DefinitionBuilder
- Synapse::Configuration::MongoEventStoreDefinitionBuilder
- Defined in:
- lib/synapse/configuration/event_store/mongo/event_store.rb
Overview
Definition builder used to create a Mongo-backed event store
Instance Method Summary collapse
-
#use_client(client) ⇒ undefined
Convenience method that creates an event store template with the given Mongo client.
-
#use_per_commit_strategy ⇒ undefined
Changes the type of storage strategy to document-per-commit.
-
#use_per_event_strategy ⇒ undefined
Changes the type of storage strategy to document-per-event.
-
#use_serializer(serializer) ⇒ undefined
Changes the serializer to use with this event store.
-
#use_template(template) ⇒ undefined
Changes the Mongo template to use with this event store.
-
#use_upcaster_chain(upcaster_chain) ⇒ undefined
Changes the upcaster chain to use with this event store.
Instance Method Details
#use_client(client) ⇒ undefined
Convenience method that creates an event store template with the given Mongo client
23 24 25 |
# File 'lib/synapse/configuration/event_store/mongo/event_store.rb', line 23 def use_client(client) @template = EventStore::Mongo::Template.new client end |
#use_per_commit_strategy ⇒ undefined
Changes the type of storage strategy to document-per-commit
31 32 33 |
# File 'lib/synapse/configuration/event_store/mongo/event_store.rb', line 31 def use_per_commit_strategy @storage_strategy_type = EventStore::Mongo::DocumentPerCommitStrategy end |
#use_per_event_strategy ⇒ undefined
Changes the type of storage strategy to document-per-event
39 40 41 |
# File 'lib/synapse/configuration/event_store/mongo/event_store.rb', line 39 def use_per_event_strategy @storage_strategy_type = EventStore::Mongo::DocumentPerEventStrategy end |
#use_serializer(serializer) ⇒ undefined
Changes the serializer to use with this event store
48 49 50 |
# File 'lib/synapse/configuration/event_store/mongo/event_store.rb', line 48 def use_serializer(serializer) @serializer = serializer end |
#use_template(template) ⇒ undefined
Changes the Mongo template to use with this event store
57 58 59 |
# File 'lib/synapse/configuration/event_store/mongo/event_store.rb', line 57 def use_template(template) @template = template end |
#use_upcaster_chain(upcaster_chain) ⇒ undefined
Changes the upcaster chain to use with this event store
66 67 68 |
# File 'lib/synapse/configuration/event_store/mongo/event_store.rb', line 66 def use_upcaster_chain(upcaster_chain) @upcaster_chain = upcaster_chain end |