Class: Synapse::Command::SerializationOptimizingInterceptor
- Inherits:
-
DispatchInterceptor
- Object
- DispatchInterceptor
- Synapse::Command::SerializationOptimizingInterceptor
- Defined in:
- lib/synapse/command/interceptors/serialization.rb
Overview
Interceptor that registers a unit of work listener that wraps each event message in a serialization-aware message. This provides optimization in cases where storage (in an event store) and publication (on the event bus) use the same serialization mechansim.
Instance Method Summary collapse
- #initialize ⇒ undefined constructor
-
#intercept(command, unit, chain) ⇒ Object
The result of the execution of the command.
Constructor Details
#initialize ⇒ undefined
8 9 10 |
# File 'lib/synapse/command/interceptors/serialization.rb', line 8 def initialize @listener = SerializationOptimizingListener.new end |
Instance Method Details
#intercept(command, unit, chain) ⇒ Object
Returns The result of the execution of the command.
16 17 18 19 |
# File 'lib/synapse/command/interceptors/serialization.rb', line 16 def intercept(command, unit, chain) unit.register_listener @listener chain.proceed command end |