Skip to content

Instantly share code, notes, and snippets.

Created January 17, 2013 00:26
Show Gist options
  • Save anonymous/4552359 to your computer and use it in GitHub Desktop.
Save anonymous/4552359 to your computer and use it in GitHub Desktop.
require 'ruote'
ruote = Ruote::Dashboard.new(Ruote::Worker.new(Ruote::HashStorage.new))
class GrabUptime < Ruote::Participant
def on_workitem
node = workitem.params['node']
workitem.fields["uptime_#{node}"] = `ssh #{node} uptime`
reply
end
end
ruote.register 'grab_uptime', GrabUptime
pdef =
Ruote.define do
concurrent_iterator :on => %w[ n1 n2 n3 n4 n5 ], :mt => :union do
grab_uptime :node => '${v:i}'
end
end
wfid = ruote.launch(pdef)
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment