class Synapse::Command::DuplicationCleanupInterceptor
Interceptor that removes commands from the duplication recorder if their execution results in a transient error (like concurrency error) being raised. This way, the same command can be retried by the client or command gateway
Public Class Methods
new(recorder)
click to toggle source
@param [DuplicationRecorder] recorder @return [undefined]
# File lib/synapse/command/duplication.rb, line 25 def initialize(recorder) @recorder = recorder end
Public Instance Methods
intercept(command, unit, chain)
click to toggle source
@param [CommandMessage] command @param [UnitOfWork] unit The current unit of work for this command dispatch @param [InterceptorChain] chain @return [Object] The result of the execution of the command
# File lib/synapse/command/duplication.rb, line 33 def intercept(command, unit, chain) begin chain.proceed command rescue TransientError @recorder.forget command raise end end