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.
156 157 158 159 160 161 162 163 164 165 |
# File 'lib/rage/fiber_scheduler.rb', line 156 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 |