Skip to content

Commit 9395f6a

Browse files
committed
Minor updates to the ever-evolving ActorContext.
1 parent 26b08c2 commit 9395f6a

File tree

4 files changed

+2
-8
lines changed

4 files changed

+2
-8
lines changed

lib/concurrent/actor/actor_context.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ module ActorContext
4343
def on_start
4444
end
4545

46-
# Callback method called by the `ActorRef` which encapsulates the actor instance.
47-
def on_reset
48-
end
49-
5046
# Callback method called by the `ActorRef` which encapsulates the actor instance.
5147
def on_shutdown
5248
end

lib/concurrent/actor/simple_actor_ref.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(actor, opts = {})
1515
@stop_event = Event.new
1616
@reset_on_error = opts.fetch(:reset_on_error, true)
1717
@exception_class = opts.fetch(:rescue_exception, false) ? Exception : StandardError
18-
@args = opts.fetch(:args, {})
18+
@args = opts.fetch(:args, []) if @reset_on_error
1919

2020
@actor.define_singleton_method(:shutdown, &method(:set_stop_event))
2121
@actor.on_start
@@ -37,7 +37,7 @@ def post(*msg, &block)
3737
end
3838

3939
def post!(timeout, *msg)
40-
raise Concurrent::TimeoutError if timeout == 0
40+
raise Concurrent::TimeoutError if timeout <= 0
4141
ivar = self.post(*msg)
4242
ivar.value(timeout)
4343
if ivar.incomplete?

lib/concurrent_ruby_ext.bundle

11.3 KB
Binary file not shown.

spec/concurrent/actor/actor_context_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ module Concurrent
1616

1717
specify { subject.should respond_to :on_start }
1818

19-
specify { subject.should respond_to :on_reset }
20-
2119
specify { subject.should respond_to :on_shutdown }
2220
end
2321

0 commit comments

Comments
 (0)