Module episcina

Provides the main interface to the system.

Copyright © (C) 2013, Eric Merritt

Authors: Eric Merritt (ericbmerritt@gmail.com).

Description

Provides the main interface to the system

Data Types

close_fun()

close_fun() = fun((term()) -> ok)

connect_fun()

connect_fun() = fun(() -> term())

connection()

connection() = pid() | term()

name()

name() = any()

Function Index

get_connection/1Get a db connection, wait at most 10 seconds before giving up.
get_connection/2Get a db connection, wait at most Timeout seconds before giving up.
return_connection/2Return a db connection back to the connection pool.
start_pool/1
start_pool/5
start_pools/1
stop/1Stop the pool, close all db connections.

Function Details

get_connection/1

get_connection(Name::name()) -> {ok, connection()}

Get a db connection, wait at most 10 seconds before giving up.

get_connection/2

get_connection(Name::name(), Timeout::non_neg_integer()) -> {ok, connection()}

Get a db connection, wait at most Timeout seconds before giving up.

return_connection/2

return_connection(Name::name(), C::connection()) -> ok

Return a db connection back to the connection pool.

start_pool/1

start_pool(X1::{name(), proplists:proplist()}) -> {ok, pid()} | {error, term()}

start_pool/5

start_pool(Name::name(), Size::non_neg_integer(), Timeout::non_neg_integer(), ConnectFun::connect_fun(), CloseFun::close_fun()) -> {ok, pid()} | {error, term()}

start_pools/1

start_pools(Opts::[term()]) -> [{ok, pid()} | {error, term()}]

stop/1

stop(Name::name()) -> ok

Stop the pool, close all db connections


Generated by EDoc