Module ecpool

Data Types

action()

action() = action(any())

action()

action(Result) = {module(), atom(), [any()]} | fun((_Client::pid()) -> Result)

apply_mode()

apply_mode() = handover | handover_async | {handover, timeout()} | {handover_async, callback()} | no_handover

callback()

callback() = {module(), atom(), [any()]} | fun((any()) -> any())

conn_callback()

conn_callback() = {module(), atom(), [any()]}

option()

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

pool_name()

pool_name() = atom() | binary()

pool_type()

pool_type() = random | hash | direct | round_robin

Function Index

add_reconnect_callback/2
get_client/1Get client/connection.
get_client/2Get client/connection with hash key.
name/1ecpool name.
pick_and_do/3
pool_spec/4
remove_reconnect_callback/2
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

add_reconnect_callback/2

add_reconnect_callback(Pool::pool_name(), Callback::conn_callback()) -> ok

get_client/1

get_client(Pool::pool_name()) -> pid() | false

Get client/connection

get_client/2

get_client(Pool::pool_name(), Key::any()) -> pid() | false

Get client/connection with hash key.

name/1

name(Pool) -> any()

ecpool name

pick_and_do/3

pick_and_do(Pool::{pool_name(), term()} | pool_name(), Action::action(Result), ApplyMode::apply_mode()) -> Result | {error, disconnected | ecpool_empty}

pool_spec/4

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

remove_reconnect_callback/2

remove_reconnect_callback(Pool::pool_name(), Callback::{module(), atom()}) -> ok

set_reconnect_callback/2

set_reconnect_callback(Pool::pool_name(), Callback::conn_callback()) -> ok

start_pool/3

start_pool(Pool::pool_name(), 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::pool_name(), Fun::action(Result)) -> Result | {error, disconnected | ecpool_empty}

Call the fun with client/connection

with_client/3

with_client(Pool::pool_name(), Key::any(), Fun::action(Result)) -> Result | {error, disconnected | ecpool_empty}

Call the fun with client/connection

workers/1

workers(Pool) -> any()

Pool workers


Generated by EDoc