Module: Rage::FiberScheduler::BlockingOperationWait
- Defined in:
- lib/rage/fiber_scheduler.rb
Instance Method Summary collapse
-
#blocking_operation_wait(work) ⇒ Object
Offload a native call to the worker pool, yielding until complete.
Instance Method Details
#blocking_operation_wait(work) ⇒ Object
Offload a native call to the worker pool, yielding until complete.
140 141 142 143 144 145 146 147 148 149 |
# File 'lib/rage/fiber_scheduler.rb', line 140 def blocking_operation_wait(work) f = Fiber.current gen = (f.__wait_generation += 1) worker_pool.enqueue(work) do f.resume if f.alive? && gen == f.__wait_generation end Fiber.yield end |