class Async::WorkerPool
def call(work)
Offload work to a thread.
def call(work) if ready = @ready worker = ready.pop begin worker.call(work) ensure ready.push(worker) end else raise RuntimeError, "No worker available!" end end
def call(work) if ready = @ready worker = ready.pop begin worker.call(work) ensure ready.push(worker) end else raise RuntimeError, "No worker available!" end end