Class: Synapse::Command::DuplicationFilter

Inherits:
CommandFilter show all
Defined in:
lib/synapse/command/duplication.rb

Overview

Filter that prevents duplicate commands from reaching the command handlers

Instance Method Summary collapse

Constructor Details

#initialize(recorder) ⇒ undefined

Parameters:



7
8
9
# File 'lib/synapse/command/duplication.rb', line 7

def initialize(recorder)
  @recorder = recorder
end

Instance Method Details

#filter(command) ⇒ CommandMessage

Returns The command to dispatch on the bus.

Parameters:

Returns:



13
14
15
16
# File 'lib/synapse/command/duplication.rb', line 13

def filter(command)
  @recorder.record command
  command
end