Skip to content

Commit c643e88

Browse files
committed
Expose terminated to public to be able to wait for termination
1 parent b0a6884 commit c643e88

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

lib/concurrent/actress/core.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Core
99
include TypeCheck
1010
include Concurrent::Logging
1111

12-
attr_reader :reference, :name, :path, :executor
12+
attr_reader :reference, :name, :path, :executor, :terminated
1313

1414
# @option opts [String] name
1515
# @option opts [Reference, nil] parent of an actor spawning this one

lib/concurrent/actress/core_delegations.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ def terminated?
1919
core.terminated?
2020
end
2121

22+
def terminated
23+
core.terminated
24+
end
25+
2226
def reference
2327
core.reference
2428
end

spec/concurrent/actress_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def assert condition
147147

148148
describe 'envelope' do
149149
subject { AdHoc.spawn(:subject) { -> _ { envelope } } }
150-
specify do
150+
specify do
151151
envelope = subject.ask!('a')
152152
envelope.should be_a_kind_of Envelope
153153
envelope.message.should eq 'a'
@@ -156,8 +156,8 @@ def assert condition
156156
envelope.sender.should eq Thread.current
157157
end
158158
end
159-
end
160159

160+
end
161161
end
162162
end
163163

0 commit comments

Comments
 (0)