action() = action(any())
action(Result) = {module(), atom(), [any()]} | fun((_Client::pid()) -> Result)
apply_mode() = handover | handover_async | {handover, timeout()} | {handover_async, callback()} | no_handover
callback() = {module(), atom(), [any()]} | fun((any()) -> any())
conn_callback() = {module(), atom(), [any()]}
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() = atom() | binary()
pool_type() = random | hash | direct | round_robin
| add_reconnect_callback/2 | |
| get_client/1 | Get client/connection. |
| get_client/2 | Get client/connection with hash key. |
| name/1 | ecpool name. |
| pick_and_do/3 | |
| pool_spec/4 | |
| remove_reconnect_callback/2 | |
| set_reconnect_callback/2 | |
| start_pool/3 | Start the pool sup. |
| start_sup_pool/3 | Start the pool supervised by ecpool_sup. |
| stop_sup_pool/1 | Start the pool supervised by ecpool_sup. |
| with_client/2 | Call the fun with client/connection. |
| with_client/3 | Call the fun with client/connection. |
| workers/1 | Pool workers. |
add_reconnect_callback(Pool::pool_name(), Callback::conn_callback()) -> ok
get_client(Pool::pool_name()) -> pid() | false
Get client/connection
get_client(Pool::pool_name(), Key::any()) -> pid() | false
Get client/connection with hash key.
name(Pool) -> any()
ecpool name
pick_and_do(Pool::{pool_name(), term()} | pool_name(), Action::action(Result), ApplyMode::apply_mode()) -> Result | {error, disconnected | ecpool_empty}
pool_spec(ChildId, Pool, Mod, Opts) -> any()
remove_reconnect_callback(Pool::pool_name(), Callback::{module(), atom()}) -> ok
set_reconnect_callback(Pool::pool_name(), Callback::conn_callback()) -> ok
start_pool(Pool::pool_name(), Mod::atom(), Opts::[option()]) -> {ok, pid()} | {error, term()}
Start the pool sup.
start_sup_pool(Pool, Mod, Opts) -> any()
Start the pool supervised by ecpool_sup
stop_sup_pool(Pool) -> any()
Start the pool supervised by ecpool_sup
with_client(Pool::pool_name(), Fun::action(Result)) -> Result | {error, disconnected | ecpool_empty}
Call the fun with client/connection
with_client(Pool::pool_name(), Key::any(), Fun::action(Result)) -> Result | {error, disconnected | ecpool_empty}
Call the fun with client/connection
workers(Pool) -> any()
Pool workers
Generated by EDoc