Permalink
Browse files

+ Update to procrastinate 0.3

This eliminates the need for explicit scheduler start. Nicer.

Nice nice nicer
small improvements
snowy day
  • Loading branch information...
kschiess committed Dec 27, 2010
1 parent 7beb36b commit 5bd0bf7bf05d3fde9bef118d9695d50c6d83363b
Showing with 15 additions and 11 deletions.
  1. +1 −1 Gemfile
  2. +8 −3 Gemfile.lock
  3. +2 −2 Rakefile
  4. +4 −5 lib/ndo/multi_command.rb
View
@@ -1,7 +1,7 @@
source "http://rubygems.org"
gem 'open4', '~> 1.0.1'
-gem 'procrastinate', '~> 0.2.0'
+gem 'procrastinate', :git => 'git://github.com/kschiess/procrastinate.git'
gem 'text-highlight'
group :development do
View
@@ -1,11 +1,16 @@
+GIT
+ remote: git://github.com/kschiess/procrastinate.git
+ revision: 8ffc5c28bda0f685d100cf1da47b8b5fc248ff43
+ specs:
+ procrastinate (0.3.0)
+ state_machine (~> 0.9.4)
+
GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.1.2)
flexmock (0.8.11)
open4 (1.0.1)
- procrastinate (0.2.0)
- state_machine (~> 0.9.4)
rspec (2.3.0)
rspec-core (~> 2.3.0)
rspec-expectations (~> 2.3.0)
@@ -23,6 +28,6 @@ PLATFORMS
DEPENDENCIES
flexmock
open4 (~> 1.0.1)
- procrastinate (~> 0.2.0)
+ procrastinate!
rspec
text-highlight
View
@@ -32,8 +32,8 @@ spec = Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.add_dependency 'open4', '~> 1.0.1'
- s.add_dependency 'procrastinate', '~> 0.2.0'
- s.add_dependency 'text-highlight'
+ s.add_dependency 'procrastinate', '~> 0.3.0'
+ s.add_dependency 'text-highlight' '~> 1.0.0'
s.add_development_dependency("rspec")
s.add_development_dependency("flexmock")
View
@@ -1,7 +1,9 @@
+require 'procrastinate'
+require 'procrastinate/implicit'
+
require 'ndo/results'
require 'ndo/host'
-require 'procrastinate'
# A class to execute a command on a list of hosts in parallel; allows access
# to results and is thus a) multi threaded and b) Ruby 1.9.2 only.
@@ -20,15 +22,12 @@ def initialize(command, hosts)
# Runs the command on all hosts. Returns a result collection.
#
def run
- scheduler = Scheduler.start(SpawnStrategy::Throttled.new(5))
- proxy = scheduler.create_proxy(self)
+ proxy = Procrastinate.proxy(self)
Ndo::Results.new.tap { |results|
hosts.each { |host|
results.store host, proxy.run_for_host(host)
}}
- ensure
- scheduler.shutdown
end
def run_for_host(host)

0 comments on commit 5bd0bf7

Please sign in to comment.