Skip to content

Commit fa3670e

Browse files
committed
remove Ractor#close
close_incoming by antoher ractor means there is no other messages will be sent to the ractor, so Ractor.receive will block forever, and it should raise and stop. close_outgoing by antoher ractor means, ... I don't have good idea to use it. It can be a private method. Ractor#close calls both, but it does not make sense to call different purpose methods, so I remove it.
1 parent deed21b commit fa3670e

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

bootstraptest/test_ractor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ def test n
201201
# Raise Ractor::ClosedError when try to send into a closed actor
202202
assert_equal 'ok', %q{
203203
r = Ractor.new { Ractor.receive }
204+
r.close_incoming
204205
205-
r.close
206206
begin
207207
r.send(1)
208208
rescue Ractor::ClosedError
@@ -219,7 +219,7 @@ def test n
219219
Ractor.receive
220220
end
221221
222-
r.close
222+
r.close_outgoing
223223
begin
224224
r.take
225225
rescue Ractor::ClosedError

ractor.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,6 @@ def close_outgoing
164164
}
165165
end
166166

167-
# Closes both incoming and outgoing ports.
168-
def close
169-
close_incoming
170-
close_outgoing
171-
172-
self
173-
end
174-
175167
# utility method
176168
def self.shareable? obj
177169
__builtin_cexpr! %q{

0 commit comments

Comments
 (0)