Skip to content

Instantly share code, notes, and snippets.

@Gurpartap
Created July 27, 2012 22:35
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 Gurpartap/3190784 to your computer and use it in GitHub Desktop.
Save Gurpartap/3190784 to your computer and use it in GitHub Desktop.
ruote getting started
class Server
...
pdef_provision = Ruote.process_definition do
cursor do
provision
rewind :if => '${not_ok}'
end
end
...
def provision
RuoteDashboard.launch(pdef_provision)
end
end
RuoteStorage = Ruote::Redis::Storage.new(::Redis.new(:db => 0, :thread_safe => true), {})
# RuoteDashboard = Ruote::Dashboard.new(RuoteStorage)
RuoteDashboard = Ruote::Dashboard.new(Ruote::Worker.new(RuoteStorage))
require 'json'
require 'redis'
require 'ruote'
require 'ruote-redis'
storage = Ruote::Redis::Storage.new(::Redis.new(:db => 0, :thread_safe => true), {})
dashboard = Ruote::Dashboard.new(Ruote::Worker.new(storage))
dashboard.register_participant :provision do |workitem|
print "should we provision? "
workitem.fields['not_ok'] = (gets.strip == 'no')
end
sleep 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment