Class: Farce::Pool
- Inherits:
-
Abstract::Pool
- Object
- Abstract::Executor
- Abstract::Pool
- Farce::Pool
- Includes:
- Shareable::Unfreezable
- Defined in:
- lib/farce/pool.rb
Overview
A dynamically sized pool of Ractor schedulers.
Tasks wait in one shared queue. An empty pool starts its first worker immediately
when work arrives. A task that remains queued for grow_after
causes the pool to add a worker until max_size is reached. Workers above
min_size retire after shrink_after without queued or running work.
By default, the pool starts with no workers and can shrink back to zero.
Worker limits, task limits, scaling delays, and queue capacity can change while
the pool runs. Lowering max_size retires extra workers as they become idle.
Busy workers keep queued work runnable. Raising min_size starts workers
immediately. Queued tasks are retained.
Most importantly, it exposes a Abstract::Pool#schedule method compatible with Abstract::Scheduler#schedule.
Method Summary
Methods included from Shareable
#initialize, #ractor_shareable?
Methods inherited from Abstract::Pool
#at_max_size?, #capacity, #capacity=, #close, #closed?, #closing?, #error, #grow_after, #grow_after=, #initialize, #max_inflight, #max_inflight=, #max_size, #max_size=, #min_size, #min_size=, #schedule, #shrink_after, #shrink_after=, #size, #state, #try_schedule
Methods inherited from Abstract::Executor
#close, #close_all, #closed?, #error, #execute, #local?, #ractor_shareable?, #schedule, #state, #try_schedule