Skip to content

Instantly share code, notes, and snippets.

Created January 25, 2013 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4630056 to your computer and use it in GitHub Desktop.
Save anonymous/4630056 to your computer and use it in GitHub Desktop.
rvm use 1.9.3-p194
#require 'rubygems'
# running with "bundle exec ruby camel.rb", so no need for this
require 'ruote'
require 'ruote/storage/fs_storage'
def get_storage
Ruote::FsStorage.new("ruote_issue_work")
end
class MyParticipant < Ruote::Participant
def on_workitem
puts "#{self.class} pid=#{$$} saw workitem for #{workitem.participant_name}, workflow_type=#{f.workflow_type}"
reply
end
end
def launch
ruote = Ruote::Dashboard.new( get_storage )
ruote.noisy = (ENV['NOISY'] == 'true')
ruote.register do
participant 'alpha', MyParticipant
catchall MyParticipant
end
pdef =
Ruote.define do
alpha
bravo
end
wfid = ruote.launch(pdef)
puts "submitted #{wfid}"
ruote.join
end
case ARGV[0]
when "run"
ruote = Ruote::Dashboard.new(Ruote::Worker.new( get_storage ))
ruote.noisy = (ENV['NOISY'] == 'true')
puts "waiting for task to complete"
ruote.join
puts "exiting worker"
exit!
when "launch"
launch
puts "exiting Dashboard/launch command"
exit!
end
source :rubygems
gem 'yajl-ruby', :require => 'yajl'
gem 'ruote'
GEM
remote: http://rubygems.org/
specs:
blankslate (2.1.2.4)
file-tail (1.0.12)
tins (~> 0.5)
parslet (1.4.0)
blankslate (~> 2.0)
ruby2ruby (1.3.1)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
ruby_parser (2.3.1)
sexp_processor (~> 3.0)
rufus-cloche (1.0.2)
rufus-json (>= 1.0.1)
rufus-dollar (1.0.4)
rufus-json (1.0.2)
rufus-mnemo (1.2.3)
rufus-scheduler (2.0.17)
tzinfo (>= 0.3.23)
rufus-treechecker (1.0.8)
ruby_parser (>= 2.0.5)
ruote (2.3.0.2)
blankslate (= 2.1.2.4)
parslet (= 1.4.0)
ruby_parser (~> 2.3)
rufus-cloche (>= 1.0.2)
rufus-dollar (>= 1.0.4)
rufus-json (>= 1.0.1)
rufus-mnemo (>= 1.2.2)
rufus-scheduler (>= 2.0.16)
rufus-treechecker (>= 1.0.8)
sourcify (= 0.5.0)
sexp_processor (3.2.0)
sourcify (0.5.0)
file-tail (>= 1.0.5)
ruby2ruby (>= 1.2.5)
ruby_parser (>= 2.0.5)
sexp_processor (>= 3.0.5)
tins (0.6.0)
tzinfo (0.3.35)
yajl-ruby (1.1.0)
PLATFORMS
ruby
DEPENDENCIES
ruote
yajl-ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment