Created
January 17, 2013 00:26
-
-
Save anonymous/4552359 to your computer and use it in GitHub Desktop.
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 '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