Class: Farce::Ractor::Port
- Inherits:
-
Object
- Object
- Farce::Ractor::Port
- Defined in:
- lib/farce/_yard/ractor.rb
Overview
Either Ractor::Port or a shim for it. It is recommended to use Farce::Port instead,
which will always be a subclass of this class, but has added safety and functionality.
Direct Known Subclasses
Instance Method Summary collapse
-
#close
Closes the port.
-
#closed? ⇒ Boolean
Checks it the port is closed.
- #receive ⇒ BasicObject
-
#send(message, move: false) ⇒ self
(also: #<<)
Sends a message over the port.
Instance Method Details
#close
This method returns an undefined value.
Closes the port. Sending to a closed port is prohibited. Receiving is also prohibited if there are no messages in its message queue. Only the Ractor which created the port is allowed to close it.
15 |
# File 'lib/farce/_yard/ractor.rb', line 15 def close = super |
#closed? ⇒ Boolean
Checks it the port is closed.
20 |
# File 'lib/farce/_yard/ractor.rb', line 20 def closed? = super |
#receive ⇒ BasicObject #receive(timeout: nil) ⇒ BasicObject?
35 |
# File 'lib/farce/_yard/ractor.rb', line 35 def receive = super |
#send(message, move: false) ⇒ self Also known as: <<
Sends a message over the port.
42 |
# File 'lib/farce/_yard/ractor.rb', line 42 def send(, move: false) = super |