GenMagic.Pool behaviour (GenMagic v1.1.1) View Source

The GenMagic.Pool behaviour defines functions that must be implemented by each pool module which is added under the GenMagic.Pool namespace.

Link to this section Summary

Types

The name of the pool, which is usually a pid or an atom for named pools

The options that must be accepted by the pool

Link to this section Types

Specs

name() :: term()

The name of the pool, which is usually a pid or an atom for named pools

Specs

perform_option() :: {:timeout, timeout()}

Specs

startup_option() ::
  {:pool_name, atom()}
  | {:pool_size, non_neg_integer()}
  | {:startup_timeout, timeout()}
  | {:process_timeout, timeout()}
  | {:recycle_threshold, non_neg_integer() | :infinity}
  | {:database_patterns, [:default | Path.t(), ...]}

The options that must be accepted by the pool

Link to this section Callbacks

Link to this callback

perform(name, arg2, list)

View Source

Specs

perform(name(), Path.t(), [perform_option()]) ::
  {:ok, GenMagic.Result.t()} | {:error, term()}

Specs

start_link([startup_option()]) :: {:ok, pid()} | {:error, term()}