Class: Synapse::Configuration::SimpleCommandBusDefinitionBuilder
- Inherits:
-
DefinitionBuilder
- Object
- DefinitionBuilder
- Synapse::Configuration::SimpleCommandBusDefinitionBuilder
- Defined in:
- lib/synapse/configuration/component/command_bus/simple_command_bus.rb
Overview
Support for interceptors and filters
Definition builder used to create a simple command bus
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from DefinitionBuilder
Instance Method Summary collapse
-
#use_handler_tag(handler_tag) ⇒ undefined
Changes the tag to use to automatically subscribe command handlers.
-
#use_rollback_policy(rollback_policy) ⇒ undefined
Changes the rollback policy to use for the command bus.
-
#use_unit_factory(unit_factory) ⇒ undefined
Changes the unit of work factory to use with this command bus.
Methods inherited from DefinitionBuilder
#anonymous, #as_prototype, #as_singleton, build, #build_composite, #build_definition, #identified_by, #initialize, #register_definition, #resolve, #resolve_tagged, #tag, #use_factory, #use_instance
Constructor Details
This class inherits a constructor from Synapse::Configuration::DefinitionBuilder
Instance Method Details
#use_handler_tag(handler_tag) ⇒ undefined
Changes the tag to use to automatically subscribe command handlers
Note that command handlers that are tagged must support self-subscription to the command bus. An example of a handler capable of doing so is the wiring command handler.
22 23 24 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 22 def use_handler_tag(handler_tag) @handler_tag = handler_tag end |
#use_rollback_policy(rollback_policy) ⇒ undefined
Changes the rollback policy to use for the command bus
By default, the command bus will always rollback on an exception
32 33 34 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 32 def use_rollback_policy(rollback_policy) @rollback_policy = rollback_policy end |
#use_unit_factory(unit_factory) ⇒ undefined
Changes the unit of work factory to use with this command bus
40 41 42 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 40 def use_unit_factory(unit_factory) @unit_factory = unit_factory end |