Class: Synapse::Configuration::SimpleCommandBusDefinitionBuilder
- Inherits:
-
DefinitionBuilder
- Object
- DefinitionBuilder
- Synapse::Configuration::SimpleCommandBusDefinitionBuilder
- Defined in:
- lib/synapse/configuration/component/command_bus/simple_command_bus.rb
Overview
Definition builder used to create a simple command bus
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from DefinitionBuilder
Instance Method Summary collapse
-
#use_filter_tag(filter_tag) ⇒ undefined
Changes the tag to use to automatically register command filters.
-
#use_handler_tag(handler_tag) ⇒ undefined
Changes the tag to use to automatically subscribe command handlers.
-
#use_interceptor_tag(interceptor_tag) ⇒ undefined
Changes the tag to use to automatically register command filters.
-
#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, #tag, #use_factory, #use_instance
Constructor Details
This class inherits a constructor from Synapse::Configuration::DefinitionBuilder
Instance Method Details
#use_filter_tag(filter_tag) ⇒ undefined
Changes the tag to use to automatically register command filters
30 31 32 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 30 def use_filter_tag(filter_tag) @filter_tag = filter_tag end |
#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_interceptor_tag(interceptor_tag) ⇒ undefined
Changes the tag to use to automatically register command filters
38 39 40 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 38 def use_interceptor_tag(interceptor_tag) @interceptor_tag = interceptor_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
48 49 50 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 48 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
56 57 58 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 56 def use_unit_factory(unit_factory) @unit_factory = unit_factory end |