Class: FiberRecycling::RootFiberBackend
- Inherits:
-
FiberBackend
- Object
- FiberBackend
- FiberRecycling::RootFiberBackend
- Defined in:
- lib/fiber_recycling/root_fiber_backend.rb
Instance Attribute Summary collapse
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Class Method Summary collapse
Instance Method Summary collapse
- #alive? ⇒ Boolean
-
#initialize ⇒ RootFiberBackend
constructor
A new instance of RootFiberBackend.
- #inspect ⇒ Object
- #resume(*args) ⇒ Object
- #to_s ⇒ Object
- #transfer(*args) ⇒ Object
Constructor Details
#initialize ⇒ RootFiberBackend
Returns a new instance of RootFiberBackend.
10 11 12 |
# File 'lib/fiber_recycling/root_fiber_backend.rb', line 10 def initialize @variables = {} end |
Instance Attribute Details
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
8 9 10 |
# File 'lib/fiber_recycling/root_fiber_backend.rb', line 8 def variables @variables end |
Class Method Details
.yield(*args) ⇒ Object
4 5 6 |
# File 'lib/fiber_recycling/root_fiber_backend.rb', line 4 def self.yield(*args) raise FiberError, "can't yield from root fiber" end |
Instance Method Details
#alive? ⇒ Boolean
14 15 16 |
# File 'lib/fiber_recycling/root_fiber_backend.rb', line 14 def alive? ::Fiber.root.alive? end |
#inspect ⇒ Object
18 19 20 |
# File 'lib/fiber_recycling/root_fiber_backend.rb', line 18 def inspect ::Fiber.root.inspect end |
#resume(*args) ⇒ Object
22 23 24 |
# File 'lib/fiber_recycling/root_fiber_backend.rb', line 22 def resume(*args) ::Fiber.root.resume(*args) end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/fiber_recycling/root_fiber_backend.rb', line 26 def to_s "#<RecycledFiber::Fiber:#{object_hexid}>" end |
#transfer(*args) ⇒ Object
30 31 32 |
# File 'lib/fiber_recycling/root_fiber_backend.rb', line 30 def transfer(*args) ::Fiber.root.transfer(*args) end |