| 2011-01-12 06:22:41 utc | jmettraux | alterscapes: hello and welcome to #ruote |
| 2011-01-12 06:23:01 utc | alterscapes | thank you jmettraux |
| 2011-01-12 07:38:17 utc | jmettraux | kschiess: hello, quick question : "features tree transformations to be able to act on your grammar"... act on the resulting tree ? |
| 2011-01-12 07:39:25 utc | kschiess | Instead of inline blocks, parslet generates Ruby Hashes and Arrays. To act on those, it has a pattern matcher built in. So to act on your grammar (to build an AST), you'll need the pattern matcher. Maybe the phrasing is off? |
| 2011-01-12 07:41:49 utc | jmettraux | tree transformation... AST transformation ? |
| 2011-01-12 07:41:53 utc | jmettraux | lisp macro ? |
| 2011-01-12 07:42:39 utc | kschiess | The output of the parser is not stable as the grammar changes. So I built an intermediary step that allows you to keep the AST stable. (looking for a link...) |
| 2011-01-12 07:43:10 utc | kschiess | http://kschiess.github.com/parslet/get-started.html skip to "Tree output and what to do about it" |
| 2011-01-12 07:43:50 utc | kschiess | Or did you already read that? |
| 2011-01-12 07:44:37 utc | jmettraux | only skimmed |
| 2011-01-12 07:44:40 utc | jmettraux | thanks |
| 2011-01-12 07:44:49 utc | jmettraux | now I think I understand |
| 2011-01-12 07:45:14 utc | kschiess | It decouples the parser from the AST creation. |
| 2011-01-12 07:45:48 utc | kschiess | Look at the examples directory, for example: https://github.com/kschiess/parslet/blob/master/example/parens.rb |
| 2011-01-12 07:45:54 utc | kschiess | (Has other cool uses) |
| 2011-01-12 07:47:09 utc | jmettraux | it does way more than Treetop, right ? |
| 2011-01-12 07:47:42 utc | kschiess | ... Less and more ;) |
| 2011-01-12 07:47:47 utc | jmettraux | :-) |
| 2011-01-12 07:47:59 utc | jmettraux | well done, kudos for the ruby inside coverage |
| 2011-01-12 07:48:06 utc | kschiess | Just asked for it ;) |
| 2011-01-12 07:48:11 utc | kschiess | But thanks |
| 2011-01-12 11:32:34 utc | gonzalo | hi all |
| 2011-01-12 11:32:53 utc | tosch_le | hi gonzalo! |
| 2011-01-12 11:33:21 utc | gonzalo | hi tosch_le |
| 2011-01-12 11:33:40 utc | jmettraux | hi gonzalo ! |
| 2011-01-12 11:33:41 utc | gonzalo | i'm using ruote-kit and i have a process that is meant to run forever |
| 2011-01-12 11:33:46 utc | gonzalo | hi john |
| 2011-01-12 11:34:09 utc | gonzalo | is there a way to always start ruote-kit and have that process running |
| 2011-01-12 11:34:28 utc | gonzalo | if it is not, start it. if exist just do nothing |
| 2011-01-12 11:34:51 utc | tosch_le | the process runs inside ruote, not ruote-kit |
| 2011-01-12 11:35:03 utc | tosch_le | do you use ruote-kit inside rails? |
| 2011-01-12 11:35:20 utc | gonzalo | no just ruote-kit stand alone |
| 2011-01-12 11:35:36 utc | jmettraux | http://groups.google.com/group/openwferu-users/browse_thread/thread/11f05aff7f1315bd |
| 2011-01-12 11:35:40 utc | tosch_le | then i'd start the process in config.ru, for example |
| 2011-01-12 11:35:49 utc | jmettraux | +1 |
| 2011-01-12 11:35:51 utc | gonzalo | cool guys! |
| 2011-01-12 11:36:17 utc | tosch_le | (after checking if it's already running) |
| 2011-01-12 11:36:20 utc | gonzalo | many thanks, i thought about using config.ru for that but i wanted to know more views |
| 2011-01-12 11:37:18 utc | gonzalo | :) |
| 2011-01-12 11:37:29 utc | jmettraux | https://github.com/jmettraux/ruote/blob/ruote2.1/lib/ruote/engine.rb#L100-113 |
| 2011-01-12 11:37:40 utc | jmettraux | a launch_single in config.ru |
| 2011-01-12 11:38:21 utc | gonzalo | oh cool, there's a method for "singleton" processes |
| 2011-01-12 11:38:37 utc | gonzalo | many thanks for the tip |
| 2011-01-12 11:38:58 utc | tosch_le | config.ru is fine imho |
| 2011-01-12 11:39:15 utc | jmettraux | follow tosch_le, he's the ruote-kit master |
| 2011-01-12 11:39:28 utc | gonzalo | perfect then. i'll go that way |
| 2011-01-12 11:39:56 utc | gonzalo | thank you much guys |
| 2011-01-12 11:40:08 utc | tosch_le | but you might want to separate things more, having a method in your apps namespace may be more appropriate for documentation purposes |
| 2011-01-12 11:40:26 utc | tosch_le | just call that method in config.ru |
| 2011-01-12 11:40:51 utc | tosch_le | it depends on your needs |
| 2011-01-12 11:41:27 utc | gonzalo | well, this kind of processes are in /pdefs//system |
| 2011-01-12 11:41:35 utc | gonzalo | sorry /pdefs/system |
| 2011-01-12 11:41:46 utc | gonzalo | all of them should be 'single' |
| 2011-01-12 11:42:19 utc | tosch_le | i meant ruby namespace |
| 2011-01-12 11:43:44 utc | gonzalo | ummm... i'll think about it |
| 2011-01-12 11:45:34 utc | tosch_le | something like that: https://gist.github.com/776060 |
| 2011-01-12 11:46:38 utc | gonzalo | very clean! thanks for the suggestion. i'll do it as you said. :) |
| 2011-01-12 12:25:41 utc | gonzalo | ummm... launch_single is working pretty well, but now i'm thinking in the case where the process that is meant to run forever is killed accidentally. is there a easy way for ruote to know this fact and restart the workflow. is something similar to erlang and its monitors |
| 2011-01-12 12:26:30 utc | jmettraux | well, ruote 2.1.12 (edge) has engine.on_error = "x" |
| 2011-01-12 12:26:47 utc | jmettraux | and engine.on_terminate = "x" |
| 2011-01-12 12:27:00 utc | gonzalo | umm cool! |
| 2011-01-12 12:27:22 utc | gonzalo | ok, good to know |
| 2011-01-12 12:27:38 utc | jmettraux | if you need something more precise, please tell me |
| 2011-01-12 12:27:52 utc | jmettraux | https://github.com/jmettraux/ruote/blob/ruote2.1/test/functional/ft_49_engine_on_error.rb |
| 2011-01-12 12:27:54 utc | gonzalo | no, i guess that is fine |
| 2011-01-12 12:28:01 utc | jmettraux | https://github.com/jmettraux/ruote/blob/ruote2.1/test/functional/ft_53_engine_on_terminate.rb |
| 2011-01-12 12:29:08 utc | gonzalo | thanks for the info :P |
| 2011-01-12 12:29:14 utc | jmettraux | you're welcome |
| 2011-01-12 12:36:58 utc | gonzalo | as far as I see, engine.on_terminate grabs every event terminate |
| 2011-01-12 12:37:09 utc | jmettraux | yes |
| 2011-01-12 12:37:42 utc | gonzalo | maybe it would be nice to have a engine.on_terminate(wfid) that only gets called when process with wfid is terminated |
| 2011-01-12 12:38:07 utc | gonzalo | well it's just a quick thought, maybe it is not that useful |
| 2011-01-12 12:38:26 utc | jmettraux | you can pass a participant name, a subprocess name or a process definition tree |
| 2011-01-12 12:38:33 utc | tosch_le | for that case, a on_terminate expression would be better imho |
| 2011-01-12 12:38:39 utc | gonzalo | probably a flag in launch_single like :cant_die => true would be cleaner |
| 2011-01-12 12:38:42 utc | jmettraux | aah + 1 |
| 2011-01-12 12:39:28 utc | tosch_le | +1 |
| 2011-01-12 12:39:53 utc | jmettraux | (can't remember if there is an on_terminate for processes, I think not, since you can simply place the on_terminate at the end...) |
| 2011-01-12 12:40:05 utc | jmettraux | (there's on_cancel and on_error though) |
| 2011-01-12 12:40:23 utc | gonzalo | yes |
| 2011-01-12 12:41:04 utc | tosch_le | so you could use a participant which calls launch_single as the last step |
| 2011-01-12 12:41:07 utc | gonzalo | it could restart it self with the :on_cancel attribute |
| 2011-01-12 12:42:54 utc | gonzalo | ok, many thanks again for the comments :P |
| 2011-01-12 12:43:15 utc | jmettraux | what is the use case ? The singleton process ends up in an error ? |
| 2011-01-12 12:43:28 utc | jmettraux | or the singleton process is killed inadvertently ? |
| 2011-01-12 12:43:39 utc | jmettraux | (admin kills it) |
| 2011-01-12 12:43:39 utc | gonzalo | second one |
| 2011-01-12 12:44:02 utc | gonzalo | yes it's very weird but may happen |
| 2011-01-12 12:44:18 utc | jmettraux | wouldn't it be easier to babyproof the app to prevent singleton processes to get cancelled then ? |
| 2011-01-12 12:44:19 utc | gonzalo | someone accidentally kills it |
| 2011-01-12 12:44:56 utc | jmettraux | (... cron process that launch_single maybe ...) |
| 2011-01-12 12:44:56 utc | gonzalo | well, i think you are tight |
| 2011-01-12 12:45:03 utc | gonzalo | right |
| 2011-01-12 12:45:26 utc | gonzalo | it's best to prevent anybody from invoking a DELETE on those wfid |
| 2011-01-12 12:45:42 utc | gonzalo | i think its the reasonable aproach |
| 2011-01-12 12:46:36 utc | jmettraux | there are no "users" in ruote... An operating system would prevent user john from killing processes launched as root... |
| 2011-01-12 12:47:02 utc | tosch_le | i like the on_cancel approach. it documents that the process should live forever inside the process def |
| 2011-01-12 12:47:22 utc | jmettraux | right |
| 2011-01-12 12:47:50 utc | gonzalo | nice i like your approach |
| 2011-01-12 12:49:48 utc | gonzalo | got to go now, thanks again for your invaluable tips! :P |
| 2011-01-12 12:50:32 utc | tosch_le | you're welcome, bye! |
| 2011-01-12 12:51:55 utc | jmettraux | bye ! |
| 2011-01-12 13:47:32 utc | gonzalo | hi again, i've found a weird behaviour with launch_single(). when i start ruote-kit, launch_single starts process "P". then i cancel that process and stop ruote-kit. again, i run ruote-kit and process P should be launched again since i killed it before, but it doesn't appear in /processes |
| 2011-01-12 13:48:31 utc | jmettraux | no error ? |
| 2011-01-12 13:49:12 utc | gonzalo | no |
| 2011-01-12 13:49:18 utc | gonzalo | it cancels well |
| 2011-01-12 13:49:29 utc | gonzalo | i've seen one curious thing |
| 2011-01-12 13:49:43 utc | gonzalo | i print the wfid everytime ruote-kit starts |
| 2011-01-12 13:49:54 utc | gonzalo | and the wfid is the same |
| 2011-01-12 13:50:20 utc | gonzalo | the difference is that the second time I start ruote-kit /processes doesn't show the process |
| 2011-01-12 13:50:56 utc | jmettraux | I think I understand |
| 2011-01-12 13:51:06 utc | jmettraux | I think the process is not supposed to stop |
| 2011-01-12 13:51:39 utc | gonzalo | ok |
| 2011-01-12 13:51:41 utc | jmettraux | I'm slowly closing the shop here |
| 2011-01-12 13:51:56 utc | jmettraux | could you please summarize the issue in an email to the mailing list ? |
| 2011-01-12 13:52:04 utc | jmettraux | I'll deal with that ASAP |
| 2011-01-12 13:52:16 utc | gonzalo | yes of course, no problem |
| 2011-01-12 13:52:24 utc | gonzalo | i'll report this to the mailing list |
| 2011-01-12 13:52:55 utc | jmettraux | :- |
| 2011-01-12 13:53:00 utc | jmettraux | ) |
| 2011-01-12 13:53:08 utc | gonzalo | goodnight john |
| 2011-01-12 13:56:10 utc | jmettraux | thanks ! |
| 2011-01-12 13:56:13 utc | jmettraux | ciao ! |