On Fri, Sep 24, 2010 at 01:54:33AM -0700, Eric Platon wrote:
> Hi,

Salut Eric,

it was nice meeting you at the Ruby meetup.

> I am evaluating how Ruote deals with crashes at the workflow level.
> Resumption works, with an unexpected side-effect: The engine does
> resume a crashed process, but it also runs the workflow once more!
> 
> I am probably doing something wrong. Here is a contrived example to
> show the problem.

I have the impression it's only a simple misunderstanding, how about this 
version of the quickstart :

  http://gist.github.com/595132

The launch part has been modified like this :

---8<---
WFID_FILE = 'ruote_quickstart_wfid.txt'

wfid = File.read(WFID_FILE).strip rescue nil

wfid ||= engine.launch(pdef)

File.open(WFID_FILE, 'wb') { |f| f.write(wfid) }

engine.wait_for(wfid)
  # blocks current thread until our process instance terminates

FileUtils.rm(WFID_FILE)
--->8---

I use variations of this pattern when I want to ensure that only 1 instance of 
a specific process definition runs at some point (usually it's a process that 
involves a cron expression ( http://ruote.rubyforge.org/exp/cron.html ).

Usually ruote is used inside of a web application or as a standalone worker and 
it's supposed to never exit. Processes are running and so on. Processes are not 
automatically launched as the webapp or the worker starts, they are launched (a 
bit) later on, triggered by an external event.

Sorry if the quickstart is misleading.

I'd suggest looking at ruote-kit

  http://github.com/tosch/ruote-kit

for a web application (rack) that wraps ruote with a decent web interface. 
Maybe it's easier to get a feel for "ruote, the service" in that context.

So, it's not a bug, the two launch requests were honoured.


Cheers !

-- 
John Mettraux - http://jmettraux.wordpress.com

-- 
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