Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.