katipo_pool (katipo v2.0.0-rc.2)

View Source

Manages pools of katipo HTTP client workers.

Summary

Functions

Starts a named pool of katipo workers with the given size and options: the curl multi options plus {max_in_flight, N | infinity} (default infinity), a per-worker cap on concurrently in-flight requests. When every worker is at its cap, requests fail fast with {error, #{code => overload}} instead of accumulating without bound.

Stops a named pool.

Types

name()

-type name() :: atom().

Functions

start(PoolName, PoolSize)

-spec start(name(), pos_integer()) -> supervisor:startchild_ret().

Equivalent to start/3.

start(PoolName, PoolSize, WorkerOpts)

-spec start(name(), pos_integer(), katipo:pool_opts()) -> supervisor:startchild_ret() | {error, map()}.

Starts a named pool of katipo workers with the given size and options: the curl multi options plus {max_in_flight, N | infinity} (default infinity), a per-worker cap on concurrently in-flight requests. When every worker is at its cap, requests fail fast with {error, #{code => overload}} instead of accumulating without bound.

stop(PoolName)

-spec stop(name()) -> ok.

Stops a named pool.