Module ecpool

Data Types

option()

option() = {pool_size, pos_integer()} | {pool_type, pool_type()} | {auto_reconnect, false | pos_integer()} | {on_reconnect, reconn_callback()} | tuple()

pool_name()

pool_name() = term()

pool_type()

pool_type() = random | hash | round_robin

reconn_callback()

reconn_callback() = {fun((pid()) -> term())}

Function Index

get_client/1Get client/connection.
get_client/2Get client/connection with hash key.
name/1ecpool name.
pool_spec/4
set_reconnect_callback/2
start_pool/3Start the pool sup.
start_sup_pool/3Start the pool supervised by ecpool_sup.
stop_sup_pool/1Start the pool supervised by ecpool_sup.
with_client/2Call the fun with client/connection.
with_client/3Call the fun with client/connection.
workers/1Pool workers.

Function Details

get_client/1

get_client(Pool::atom()) -> pid()

Get client/connection

get_client/2

get_client(Pool::atom(), Key::any()) -> pid()

Get client/connection with hash key.

name/1

name(Pool) -> any()

ecpool name

pool_spec/4

pool_spec(ChildId, Pool, Mod, Opts) -> any()

set_reconnect_callback/2

set_reconnect_callback(Pool::atom(), Callback::reconn_callback()) -> ok

start_pool/3

start_pool(Pool::atom(), Mod::atom(), Opts::[option()]) -> {ok, pid()} | {error, term()}

Start the pool sup.

start_sup_pool/3

start_sup_pool(Pool, Mod, Opts) -> any()

Start the pool supervised by ecpool_sup

stop_sup_pool/1

stop_sup_pool(Pool) -> any()

Start the pool supervised by ecpool_sup

with_client/2

with_client(Pool::atom(), Fun::fun((Client::pid()) -> any())) -> no_return()

Call the fun with client/connection

with_client/3

with_client(Pool::atom(), Key::any(), Fun::fun((Client::pid()) -> term())) -> no_return()

Call the fun with client/connection

workers/1

workers(Pool) -> any()

Pool workers


Generated by EDoc