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
56 57 58 |
# File 'lib/io/event/selector/select.rb', line 56 def fiber @fiber end |
Instance Method Details
#alive? ⇒ Boolean
63 64 65 |
# File 'lib/io/event/selector/select.rb', line 63 def alive? fiber&.alive? end |
#nullify ⇒ Object
Clear the referenced fiber.
68 69 70 |
# File 'lib/io/event/selector/select.rb', line 68 def nullify self.fiber = nil end |
#transfer(*arguments) ⇒ Object
Transfer control to the fiber if it is still available.
58 59 60 |
# File 'lib/io/event/selector/select.rb', line 58 def transfer(*arguments) fiber&.transfer(*arguments) end |