angael 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/angael/manager.rb +0 -7
- data/lib/angael/version.rb +1 -1
- data/lib/angael/worker.rb +9 -0
- data/spec/lib/angael/manager_spec.rb +1 -1
- metadata +1 -1
data/lib/angael/manager.rb
CHANGED
data/lib/angael/version.rb
CHANGED
data/lib/angael/worker.rb
CHANGED
@@ -55,6 +55,15 @@ module Angael
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
# This only exists for the sake of testing. I need a way to stub the restart!
|
59
|
+
# but not the original start!
|
60
|
+
# Note: this method is not tested directly.
|
61
|
+
# Users of this library should not call this method or depend on its existence
|
62
|
+
# or behavior.
|
63
|
+
def restart!
|
64
|
+
start!
|
65
|
+
end
|
66
|
+
|
58
67
|
def stop!
|
59
68
|
unless started?
|
60
69
|
__log("Called stop for worker with PID #{pid} but it is not started")
|
@@ -41,7 +41,7 @@ describe Angael::Manager do
|
|
41
41
|
|
42
42
|
context "when :restart_after is set to 0.5" do
|
43
43
|
subject { Angael::Manager.new(Angael::TestSupport::SampleWorker, 3, [], :restart_after => 0.5) }
|
44
|
-
it "should
|
44
|
+
it "should restart workers 1 at a time, at 1 second intervals" do
|
45
45
|
subject.workers.each do |w|
|
46
46
|
w.stub(:start!) # We don't actually need the workers to fork.
|
47
47
|
end
|