Skip to content

Commit 84e4414

Browse files
committed
Added [EXPERIMENTAL] warning to Supervisor.
1 parent 1d5175c commit 84e4414

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/concurrent/supervisor.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def abend() @status.reduce(0){|x, s| x += (s.nil? ? 1 : 0) } end
6060
alias_method :max_t, :max_time
6161

6262
def initialize(opts = {})
63+
warn '[EXPERIMENTAL] Supervisor is being completely rewritten and will change soon.'
6364
@restart_strategy = opts[:restart_strategy] || opts[:strategy] || :one_for_one
6465
@monitor_interval = (opts[:monitor_interval] || DEFAULT_MONITOR_INTERVAL).to_f
6566
@max_restart = (opts[:max_restart] || opts[:max_r] || DEFAULT_MAX_RESTART).to_i

spec/concurrent/supervisor_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ module Concurrent
55

66
describe Supervisor do
77

8+
before do
9+
# suppress deprecation warnings.
10+
Concurrent::Supervisor.any_instance.stub(:warn)
11+
Concurrent::Supervisor.stub(:warn)
12+
end
13+
814
let(:worker_class) do
915
Class.new {
1016
attr_reader :start_count, :stop_count
@@ -62,7 +68,7 @@ def stop() super(); stopped = true; end
6268

6369
after(:each) do
6470
subject.stop
65-
kill_rogue_threads
71+
kill_rogue_threads(false)
6672
@thread.kill unless @thread.nil?
6773
sleep(0.1)
6874
end

0 commit comments

Comments
 (0)