Class: LightIO::Core::LightFiber
- Inherits:
-
Fiber
- Object
- Fiber
- LightIO::Core::LightFiber
- Defined in:
- lib/lightio/core/light_fiber.rb
Overview
LightFiber is internal represent, we make slight extend on ruby Fiber to bind fibers to IOLoop
SHOULD NOT BE USED DIRECTLY
Direct Known Subclasses
Constant Summary collapse
- ROOT_FIBER =
Fiber.current
Instance Attribute Summary collapse
-
#ioloop ⇒ Object
readonly
Returns the value of attribute ioloop.
-
#on_transfer ⇒ Object
Returns the value of attribute on_transfer.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ioloop: IOloop.current, &blk) ⇒ LightFiber
constructor
A new instance of LightFiber.
- #transfer ⇒ Object
Constructor Details
#initialize(ioloop: IOloop.current, &blk) ⇒ LightFiber
Returns a new instance of LightFiber.
13 14 15 16 |
# File 'lib/lightio/core/light_fiber.rb', line 13 def initialize(ioloop: IOloop.current, &blk) @ioloop = ioloop super(&blk) end |
Instance Attribute Details
#ioloop ⇒ Object (readonly)
Returns the value of attribute ioloop.
8 9 10 |
# File 'lib/lightio/core/light_fiber.rb', line 8 def ioloop @ioloop end |
#on_transfer ⇒ Object
Returns the value of attribute on_transfer.
9 10 11 |
# File 'lib/lightio/core/light_fiber.rb', line 9 def on_transfer @on_transfer end |
Class Method Details
.is_root?(fiber) ⇒ Boolean
24 25 26 |
# File 'lib/lightio/core/light_fiber.rb', line 24 def is_root?(fiber) ROOT_FIBER == fiber end |
Instance Method Details
#transfer ⇒ Object
18 19 20 21 |
# File 'lib/lightio/core/light_fiber.rb', line 18 def transfer on_transfer.call(LightFiber.current, self) if on_transfer super end |