Module: EMDextras::Chains::SynchronousStage

Defined in:
lib/em-dextras/chains/synchronous_stage.rb

Instance Method Summary collapse

Instance Method Details

#invoke(input) ⇒ Object

Raises:

  • (NotImplementedError)


2
3
4
# File 'lib/em-dextras/chains/synchronous_stage.rb', line 2

def invoke(input)
  raise NotImplementedError.new("You must implement #invoke.")
end

#todo(input) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/em-dextras/chains/synchronous_stage.rb', line 6

def todo(input)
  begin 
    value = invoke(input)
    EMDextras::Chains::Deferrables.succeeded value
  rescue  => exception
    EMDextras::Chains::Deferrables.failed exception
  end
end