Thanks for your nice and prompt replies! I see that there are several things I 
have not looked at yet (like Redis, AMQP, receivers, etc...), so thanks for 
pointing me to that direction. After reading your posts, I have realized that I 
am confused about the way workers operate beyond the simplest pattern (when 
they 
are passed as an argument to the engine), which is the way I have used them so 
far. Browsing through the source code, as suggested, unfortunately didn't help 
me much. To make things very “practical” (and at a very basic level - please 
bear with me), consider this pair of scripts:

# Script 1
engine = Ruote::Engine.new(Ruote::FsStorage.new('ruote_test'))

engine.register_participant '.+' do |workitem|
  puts workitem.params['msg']
end

pdef = Ruote.process_definition do
  sequence do
    participant :alpha, :msg => 'Running alpha'
    participant :beta, :msg => 'Running beta'
  end
end

wfid = engine.launch(pdef)

-----------------

# Script 2
storage = Ruote::FsStorage.new('ruote_test')
worker = Ruote::Worker.new(storage)
worker.run

Ideally, I would like script 1 to launch a process instance and exit, and 
script 
2 to “pick up” that instance from the storage and execute it (by running the 
two 
scripts one after another and on the same machine). Essentially, I would like 
script 2 to output:

Running alpha
Running beta

Script 1 seems to serve the purpose (in fact, after running it, the storage 
contains a message), but script 2 apparently does not (it probably loops 
because 
it does not find any work to do, as you have already told me). How do I modify 
the scripts to get what I want? My attempts so far (adding a storage 
participant, turning participants into storage participants, ...) have been 
miserably unsuccessful. I am clearly misinterpreting some basic concepts. Btw, 
does FsStorage support multiple workers (I am on OS X)?

Nicola

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to