2 w.name = "child-events"
4 w.start = File.join(File.dirname(__FILE__), *%w[simple_server.rb])
6 # determine the state on startup
7 w.transition(:init, { true => :up, false => :start }) do |on|
8 on.condition(:process_running) do |c|
13 # determine when process has finished starting
14 w.transition(:start, :up) do |on|
15 on.condition(:process_running) do |c|
19 on.condition(:tries) do |c|
25 # start if process is not running
26 w.transition(:up, :start) do |on|
27 on.condition(:process_exits)