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, #error, #fei, #flavour, #msg, #workitem

Instance Method Summary collapse

Methods included from LocalParticipant

#_accept?, #_dont_thread?, #_on_cancel, #_on_reply, #_on_workitem, #_rtimeout, #applied_workitem, #fexp, #is_cancelled?, #is_gone?, #lookup_variable, #participant_name, #re_dispatch, #reply_to_engine, #unschedule_re_dispatch

Methods included from ReceiverMixin

#fetch_flow_expression, #fetch_workitem, #flunk, #launch, #receive, #reply, #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