Snakepit.Pool (Snakepit v0.6.10)
View SourcePool manager for external workers with concurrent initialization.
Features:
- Concurrent worker startup (all workers start in parallel)
- Simple queue-based request distribution
- Non-blocking async execution
- Automatic request queueing when workers are busy
- Adapter-based support for any external process
Summary
Functions
Waits for the pool to be fully initialized.
Returns a specification to start this module under a supervisor.
Executes a command on any available worker.
Execute a streaming command with callback.
Gets pool statistics.
Lists all worker IDs in the pool.
Starts the pool manager.
Functions
@spec await_ready(atom() | pid(), timeout()) :: :ok | {:error, Snakepit.Error.t()}
Waits for the pool to be fully initialized.
Returns :ok when all workers are ready, or {:error, %Snakepit.Error{}} if
the pool doesn't initialize within the given timeout.
Returns a specification to start this module under a supervisor.
See Supervisor.
Executes a command on any available worker.
Execute a streaming command with callback.
Gets pool statistics.
Lists all worker IDs in the pool.
Can be called with pool process or pool name:
list_workers()- all workers from all poolslist_workers(Snakepit.Pool)- all workers from all poolslist_workers(Snakepit.Pool, :pool_name)- workers from specific pool
Starts the pool manager.