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, #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_filter_tag(filter_tag) ⇒ undefined
Changes the tag to use to automatically register command filters
32 33 34 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 32 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.
23 24 25 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 23 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
41 42 43 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 41 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
52 53 54 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 52 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
61 62 63 |
# File 'lib/synapse/configuration/component/command_bus/simple_command_bus.rb', line 61 def use_unit_factory(unit_factory) @unit_factory = unit_factory end |