Skip to content

Commit cd97610

Browse files
committed
Ranamed ActorContext#on_restart to #on_reset to avoid confusion.
1 parent 5eea207 commit cd97610

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/concurrent/actor_context.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module ActorContext
77
def on_start
88
end
99

10-
def on_restart
10+
def on_reset
1111
end
1212

1313
def on_shutdown

lib/concurrent/simple_actor_ref.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def supervise
6565
@actor.on_start
6666
@thread = new_worker_thread
6767
elsif ! @thread.alive?
68-
@actor.on_restart
68+
@actor.on_reset
6969
@thread = new_worker_thread
7070
end
7171
end

spec/concurrent/actor_context_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Concurrent
2222

2323
specify { subject.should respond_to :on_start }
2424

25-
specify { subject.should respond_to :on_restart }
25+
specify { subject.should respond_to :on_reset }
2626

2727
specify { subject.should respond_to :on_shutdown }
2828
end

spec/concurrent/simple_actor_ref_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module Concurrent
6464
subject << :foo
6565
end
6666

67-
it 'does not restart the thread after shutdown' do
67+
it 'does not reset the thread after shutdown' do
6868
thread = Thread.new{ nil }
6969
Thread.should_receive(:new).once.with(no_args).and_return(thread)
7070
subject << :foo
@@ -82,9 +82,9 @@ module Concurrent
8282
subject << :foo
8383
end
8484

85-
it 'calls #on_restart when the thread is restarted' do
85+
it 'calls #on_reset when the thread is reseted' do
8686
actor = subject.instance_variable_get(:@actor)
87-
actor.should_receive(:on_restart).once.with(no_args)
87+
actor.should_receive(:on_reset).once.with(no_args)
8888
subject << :terminate
8989
sleep(0.1)
9090
subject << :foo

0 commit comments

Comments
 (0)