#!/usr/bin/env ruby require "jflow" require "slop" opts = Slop.parse do |o| o.string '-f', '--file', 'worker configuration file' end raise "You need to specify a file!" unless opts[:file] configuration = JSON.parse(File.read(opts[:file])) cli = JFlow::Cli.new(configuration) ["INT", "TERM"].each do |signal| Signal.trap(signal) do cli.shutdown_workers end end cli.start_workers