lib/openwfe/participants/participants.rb in openwferu-0.9.2 vs lib/openwfe/participants/participants.rb in openwferu-0.9.3
- old
+ new
@@ -37,30 +37,26 @@
# "made in Japan"
#
# John Mettraux at openwfe.org
#
-require 'openwfe/rudefinitions'
require 'openwfe/participants/participant'
#
# some base participant implementations
#
module OpenWFE
- class LocalParticipant
- include Participant, OwfeServiceLocator
+ #
+ # The PrintParticipant will just emit its name to the
+ # test tracer if any or to stdout else.
+ # Used by some unit tests.
+ #
+ class PrintParticipant
+ include LocalParticipant
- def reply_to_engine (workitem)
-
- get_expression_pool.reply(workitem.last_expression_id, workitem)
- end
- end
-
- class PrintParticipant < LocalParticipant
-
def consume (workitem)
tracer = @application_context['__tracer']
if tracer
@@ -75,19 +71,18 @@
#
# This participant is used by the register_participant() method of
# Engine class.
#
- # <tt>
- # engine.register_participant("the_boss") do |workitem|
- # puts "the boss received a workitem"
- # end
- # </tt>
+ # engine.register_participant("the_boss") do |workitem|
+ # puts "the boss received a workitem"
+ # end
#
# After the block executes, the BlockParticipant immediately replies
# to the engine.
#
- class BlockParticipant < LocalParticipant
+ class BlockParticipant
+ include LocalParticipant
def initialize (block)
@block = block
end