Hello Klaus,
On Thu, Apr 26, 2012 at 01:47:18PM -0700, Klaus Schmidtmamn wrote:
>
> 1. Why do I have to use the worker
> (Ruote::Worker.new(Ruote::FSStorage…) within the server Script and why
> does it work without the “worker” within the client script?
>
> If I put this part into the client script, multiple clients are able
> to work without the server(“server worker” ) :
>
> @dboard = Ruote::Dashboard.new(
> Ruote::Worker.new(
> Ruote::FsStorage.new('ruote_work')))
Well spotted.
If you have a workflow that is waiting for a long time or has a "cron"
expression and only rely on workers inside of a client, you could have a
situation where, when no clients are running, the workflows are actually not
executing (there is no worker picking up tasks). Of course, whenever a client
starts, the execution resumes, but that is annoying when you
told to a workflow to "do that at this point in time" and it happens, only
later (too late?), when a client finally kicks in.
If you have ruote running side by side (in the same Ruby process) with a
webserver, it's OK, both need to be running all the time. But what I've seen
from production is that people want to seperate the webserver from any
worker. You want to serve more web requests and you are usually happy with a
pack of workers running in the backend.
For a small organization having the worker side by side with the webserver is
OK (and it's easy to test and debug).
> 2. What do you think, will be the next step in order to integrate this
> client into a rails controller which writes out json-objects or plain
> html-stream? I do not want you solving my complete work; I just need
> an inspiration how to continue.
Well, the commands in the "for_klaus" client encompass both the controller
and the view, it's then easy to
class WorkflowController
def launch
pdef = extract_pdef_from_params
fields = extract_initial_workitem_fields_from_params
@wfid = $dashboard.launch(pdef, fields)
end
end
ruote-kit (https://github.com/kennethkalmer/ruote-kit) is full example,
although rack-centered, not rails-centered, but it's easy to find inspiration
for controllers and views in there.
https://github.com/kennethkalmer/ruote-kit/blob/master/lib/ruote-kit/resources/processes.rb
https://github.com/kennethkalmer/ruote-kit/blob/master/lib/ruote-kit/views/process.html.haml
...
Best regards,
--
John Mettraux - http://lambda.io/processi
--
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