Class: IO::Event::Selector::Select::Optional
- Inherits:
-
Struct
- Object
- Struct
- IO::Event::Selector::Select::Optional
- Defined in:
- lib/io/event/selector/select.rb
Overview
An optional reference to a fiber which can be cleared before it is resumed.
Instance Attribute Summary collapse
-
#fiber ⇒ Object
Returns the value of attribute fiber.
Instance Method Summary collapse
- #alive? ⇒ Boolean
-
#nullify ⇒ Object
Clear the referenced fiber.
-
#transfer(*arguments) ⇒ Object
Transfer control to the fiber if it is still available.
Instance Attribute Details
#fiber ⇒ Object
Returns the value of attribute fiber
62 63 64 |
# File 'lib/io/event/selector/select.rb', line 62 def fiber @fiber end |
Instance Method Details
#alive? ⇒ Boolean
69 70 71 |
# File 'lib/io/event/selector/select.rb', line 69 def alive? fiber&.alive? end |
#nullify ⇒ Object
Clear the referenced fiber.
74 75 76 |
# File 'lib/io/event/selector/select.rb', line 74 def nullify self.fiber = nil end |
#transfer(*arguments) ⇒ Object
Transfer control to the fiber if it is still available.
64 65 66 |
# File 'lib/io/event/selector/select.rb', line 64 def transfer(*arguments) fiber&.transfer(*arguments) end |