Module rdbms_worker

Poolboy worker that holds a single persistent PostgreSQL connection.

Behaviours: gen_server, poolboy_worker.

Description

Poolboy worker that holds a single persistent PostgreSQL connection.

Delegates all connection management and result normalisation to rdbms_pgsql. Connection parameters are taken from the Args proplist passed by poolboy at startup (which erlang_notifier_sup derives from the postgres application env key).

Supported call types: The worker traps exits and terminate/2 closes the connection. A connection-loss EXIT triggers a worker stop, which poolboy replaces with a fresh worker — natural reconnect.

Data Types

state()

abstract datatype: state()

Function Index

start_link/1Start and link a worker process.

Function Details

start_link/1

start_link(Args::proplists:proplist()) -> {ok, pid()} | {error, term()}

Args: Proplist of epgsql connection options.

returns: {ok, Pid} on success, or {error, Reason} on failure (typically a refused PostgreSQL connection).

Start and link a worker process.

Called by poolboy for each worker slot in the pool.


Generated by EDoc