Tweak return of Ractor#close
, add doc
This commit is contained in:
parent
7c548278f0
commit
bd6cd85155
Notes:
git
2020-10-31 04:22:46 +09:00
@ -150,21 +150,26 @@ class Ractor
|
|||||||
attr_reader :ractor
|
attr_reader :ractor
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Closes the incoming port and returns its previous state.
|
||||||
def close_incoming
|
def close_incoming
|
||||||
__builtin_cexpr! %q{
|
__builtin_cexpr! %q{
|
||||||
ractor_close_incoming(ec, RACTOR_PTR(self));
|
ractor_close_incoming(ec, RACTOR_PTR(self));
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Closes the outgoing port and returns its previous state.
|
||||||
def close_outgoing
|
def close_outgoing
|
||||||
__builtin_cexpr! %q{
|
__builtin_cexpr! %q{
|
||||||
ractor_close_outgoing(ec, RACTOR_PTR(self));
|
ractor_close_outgoing(ec, RACTOR_PTR(self));
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Closes both incoming and outgoing ports.
|
||||||
def close
|
def close
|
||||||
close_incoming
|
close_incoming
|
||||||
close_outgoing
|
close_outgoing
|
||||||
|
|
||||||
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
# utility method
|
# utility method
|
||||||
|
Loading…
x
Reference in New Issue
Block a user