Class: IO::Event::Selector::Select::Waiter
- Inherits:
-
Struct
- Object
- Struct
- IO::Event::Selector::Select::Waiter
- Defined in:
- lib/io/event/selector/select.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#fiber ⇒ Object
Returns the value of attribute fiber.
-
#tail ⇒ Object
Returns the value of attribute tail.
Instance Method Summary collapse
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events
101 102 103 |
# File 'lib/io/event/selector/select.rb', line 101 def events @events end |
#fiber ⇒ Object
Returns the value of attribute fiber
101 102 103 |
# File 'lib/io/event/selector/select.rb', line 101 def fiber @fiber end |
#tail ⇒ Object
Returns the value of attribute tail
101 102 103 |
# File 'lib/io/event/selector/select.rb', line 101 def tail @tail end |
Instance Method Details
#alive? ⇒ Boolean
102 103 104 |
# File 'lib/io/event/selector/select.rb', line 102 def alive? self.fiber&.alive? end |
#each(&block) ⇒ Object
120 121 122 123 124 125 126 |
# File 'lib/io/event/selector/select.rb', line 120 def each(&block) if fiber = self.fiber yield fiber, self.events end self.tail&.each(&block) end |
#invalidate ⇒ Object
116 117 118 |
# File 'lib/io/event/selector/select.rb', line 116 def invalidate self.fiber = nil end |
#transfer(events) ⇒ Object
106 107 108 109 110 111 112 113 114 |
# File 'lib/io/event/selector/select.rb', line 106 def transfer(events) if fiber = self.fiber self.fiber = nil fiber.transfer(events & self.events) if fiber.alive? end self.tail&.transfer(events) end |