Class: Ruote::NoOpParticipant

Inherits:
Object
  • Object
show all
Includes:
LocalParticipant
Defined in:
lib/ruote/part/no_op_participant.rb

Overview

A participant that simply replies immediately to the engine.

For testing purposes, but could be useful when used in conjunction with ‘listen’.

Instance Attribute Summary

Attributes included from LocalParticipant

#context

Instance Method Summary collapse

Methods included from LocalParticipant

#re_dispatch, #unschedule_re_dispatch

Methods included from ReceiverMixin

#applied_workitem, #fetch_flow_expression, #launch, #receive, #reply, #reply_to_engine, #sign

Constructor Details

#initialize(opts = nil) ⇒ NoOpParticipant

Returns a new instance of NoOpParticipant.



41
42
43
44
# File 'lib/ruote/part/no_op_participant.rb', line 41

def initialize(opts=nil)

  @items = {}
end

Instance Method Details

#cancel(fei, flavour) ⇒ Object



54
55
56
57
# File 'lib/ruote/part/no_op_participant.rb', line 54

def cancel(fei, flavour)

  # nothing to do
end

#consume(workitem) ⇒ Object

No operation : simply replies immediately to the engine.



49
50
51
52
# File 'lib/ruote/part/no_op_participant.rb', line 49

def consume(workitem)

  reply_to_engine(workitem)
end