| 2012-01-12 01:38:39 utc | jmettraux | chrismconley: hello, welcome to #ruote |
| 2012-01-12 01:38:51 utc | jmettraux | I've read your question |
| 2012-01-12 01:40:21 utc | jmettraux | I have the impression that you have a script that launches a process and then simply ends |
| 2012-01-12 01:40:38 utc | jmettraux | adding engine.wait_for(x) makes the script wait for the event x to happen |
| 2012-01-12 01:41:07 utc | jmettraux | you could replace the wait_for with engine.join so that the script never exits and simply sticks to the engine |
| 2012-01-12 01:43:24 utc | jmettraux | a script like this one https://gist.github.com/1597953 will immediately exit, given no chance to the engine to do any work, unless wait_for is uncommentd |
| 2012-01-12 03:22:57 utc | chrismconley | Hey John, thanks! |
| 2012-01-12 03:23:32 utc | chrismconley | yeah, you're impression is pretty accurate |
| 2012-01-12 03:24:14 utc | chrismconley | let me get a gist real quick |
| 2012-01-12 03:26:29 utc | chrismconley | here's a simplified version of my process definition: https://gist.github.com/1598359 |
| 2012-01-12 03:27:10 utc | chrismconley | The :unit participant has #on_workitem and #reply methods |
| 2012-01-12 03:27:30 utc | chrismconley | #on_workitem sets up data to be processed externally to the engine |
| 2012-01-12 03:27:45 utc | chrismconley | and the external system then calls #reply when its done |
| 2012-01-12 03:29:16 utc | chrismconley | I would expect that launching a process definition would kick off the workflow by calling the first participant's #on_workitem method |
| 2012-01-12 03:29:51 utc | chrismconley | oops, s/you're/your above |
| 2012-01-12 03:41:18 utc | jmettraux | ok, let me look at the gist |
| 2012-01-12 03:42:37 utc | jmettraux | the actuall workflow kick off is the placement of a "launch" message to be processed by the worker(s) |
| 2012-01-12 03:42:51 utc | jmettraux | the on_workitem isn't called immediately |
| 2012-01-12 03:43:27 utc | chrismconley | should I have another "worker" process running somewhere? |
| 2012-01-12 03:44:00 utc | jmettraux | if you look at https://gist.github.com/1597953, the Worker is explicitely instantiated |
| 2012-01-12 03:44:19 utc | jmettraux | what kind of application do you have ? |
| 2012-01-12 03:44:40 utc | chrismconley | right, so when does the worker process things? |
| 2012-01-12 03:44:46 utc | chrismconley | rails |
| 2012-01-12 03:45:21 utc | jmettraux | the worker is, by default, polling the storage for work, as soon as a message is in for it, it will get it and process it |
| 2012-01-12 03:46:03 utc | jmettraux | do you run on thin, unicorn, passenger ? |
| 2012-01-12 03:46:36 utc | chrismconley | okay, it seems as though the worker is never finding the work then |
| 2012-01-12 03:47:26 utc | chrismconley | i deploy to heroku, so I believe I have thin set up, but I'm testing the workflows outside of any requests |
| 2012-01-12 03:47:27 utc | jmettraux | or the order is not given, or the worker is not active, ... could be many things |
| 2012-01-12 03:47:46 utc | jmettraux | wow |
| 2012-01-12 03:48:04 utc | jmettraux | heroku kills threads after a while |
| 2012-01-12 03:48:26 utc | chrismconley | yeah, I think I saw one of your posts on the mailing list about that |
| 2012-01-12 03:49:08 utc | chrismconley | I haven't tried going to heroku yet though, just developing locally |
| 2012-01-12 03:49:56 utc | jmettraux | ah |
| 2012-01-12 03:50:18 utc | jmettraux | what does your ruote initialization code look like ? |
| 2012-01-12 03:52:19 utc | chrismconley | I just updated my gist: https://gist.github.com/1598359#file_application.rb |
| 2012-01-12 03:55:48 utc | chrismconley | looking at the Worker source, do I need to call Worker#run? or is that taken care of by Ruote internally? |
| 2012-01-12 03:56:37 utc | jmettraux | ruote takes care of it |
| 2012-01-12 03:56:56 utc | jmettraux | what server is used when you test locally ? |
| 2012-01-12 03:58:10 utc | chrismconley | i've just been testing in the console and attempting to get rspec working |
| 2012-01-12 03:58:28 utc | jmettraux | ok |
| 2012-01-12 03:59:02 utc | jmettraux | your launch code looks like ::RuoteEngine.launch(...) *? |
| 2012-01-12 03:59:55 utc | chrismconley | yeah: wf_id = RuoteEngine.launch(process_definition) |
| 2012-01-12 04:01:28 utc | chrismconley | in your gist, if we made the script sleep after launching, the toto step would eventually get called right? |
| 2012-01-12 04:01:36 utc | jmettraux | yes |
| 2012-01-12 04:01:53 utc | jmettraux | wait_for is necessary in specs |
| 2012-01-12 04:02:12 utc | jmettraux | my specs and tests for ruote are saturated with wait_for |
| 2012-01-12 04:02:32 utc | jmettraux | since all is happening asyncrhonously |
| 2012-01-12 04:02:39 utc | jmettraux | ok, now I understand your case |
| 2012-01-12 04:02:47 utc | chrismconley | okay, cool, let me start with your simple example and see if I can build up to my case |
| 2012-01-12 04:02:48 utc | jmettraux | please use wait_for |
| 2012-01-12 04:03:09 utc | chrismconley | but i don't want to wait for the reply :) |
| 2012-01-12 04:03:38 utc | chrismconley | when I use wait for, i see the #on_workitem method get called but it still waits for the reply |
| 2012-01-12 04:03:58 utc | jmettraux | which sounds sensible |
| 2012-01-12 04:04:06 utc | chrismconley | once I trigger the reply, I see that the workflow continues |
| 2012-01-12 04:04:10 utc | jmettraux | great |
| 2012-01-12 04:04:36 utc | chrismconley | but i don't want to block the current thread outside of testing |
| 2012-01-12 04:05:12 utc | jmettraux | then let the current thread so something else meanwhile |
| 2012-01-12 04:06:12 utc | chrismconley | okay, i still feel like I'm completely missing something fundamental here; hopefully that's just because I've been up too long :) |
| 2012-01-12 04:06:47 utc | chrismconley | let me take a fresh look in the morning and I'll let you know if I made any progress |
| 2012-01-12 04:06:52 utc | jmettraux | ok |
| 2012-01-12 04:07:06 utc | jmettraux | if I'm not around feel free to post on the mailing list, have a good night sleep ! |
| 2012-01-12 04:07:16 utc | chrismconley | thanks for the help and for the library in general; it's very impressive |
| 2012-01-12 04:07:18 utc | chrismconley | thanks! |
| 2012-01-12 04:07:31 utc | jmettraux | thanks! |
| 2012-01-12 08:53:39 utc | wayneeseguin | :) |
| 2012-01-12 08:53:40 utc | wayneeseguin | xoxo |
| 2012-01-12 12:06:44 utc | jmettraux | wayneeseguin: hello, long time no see ! How are you doing ? |
| 2012-01-12 15:00:19 utc | wayneeseguin | jmettraux Very good :) Focusing on dayjob these days. Looks like we get to also evaluate using ruote for a project so I'd like to chat with you sometime. |
| 2012-01-12 21:51:43 utc | jmettraux | wayneeseguin: ok, anytime, very happy to see you around |