Created
July 27, 2012 22:35
-
-
Save Gurpartap/3190784 to your computer and use it in GitHub Desktop.
ruote getting started
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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