ExPool v0.1.0 ExPool.Pool.State

The internal state of a pool.

It is a struct with the following fields:

  • :worker_mod - The worker module.
  • :size - Size of the pool
  • :sup - Pool supervisor
  • :workers - List of available worker processes
  • :waiting - Queue to store the waiting requests

Summary

Functions

Creates a new pool state with the given configuration

Types

t :: %ExPool.Pool.State{worker_mod: atom, size: non_neg_integer, sup: pid, workers: [pid], monitors: :ets.tid, waiting: any}

Functions

new(config)

Specs

new(config :: [Keyword]) :: State.t

Creates a new pool state with the given configuration.

Configuration options

  • :worker_mod - (Required) The worker module. It has to fit in a supervision tree (like a GenServer).

  • :size - (Optional) The size of the pool (default 5).