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, :restart], :up) do |on|
15 on.condition(:process_running) do |c|
20 on.condition(:tries) do |c|
26 # start if process is not running
27 w.transition(:up, :start) do |on|
28 on.condition(:process_exits)