category
amqp_pool
AMQP connection pool category. Import this category into an object to create a named connection pool with automatic connection management.
logtalk_load(amqp(loader))staticPublic predicates
initialize/1
Initializes the connection pool with the given configuration options. Must be called before using other pool predicates.
staticinitialize(Options)initialize(+list) - one_or_error
Option host(Host): AMQP server hostname. Default is localhost.
Option port(Port): AMQP server port. Default is 5672.
Option min_size(N): Minimum number of connections to maintain. Default is 1.
Option max_size(N): Maximum number of connections allowed. Default is 10.
Option connection_options(Options): Options passed to amqp::connect/4. Default is [].
destroy/0
Destroys the pool, closing all connections and clearing state.
staticdestroy - oneacquire/1
Acquires a connection from the pool. Returns an available connection or creates a new one if the pool is not at maximum capacity.
staticacquire(Connection)acquire(--compound) - one_or_errorpool_error(not_initialized)pool_error(exhausted)release/1
Releases a connection back to the pool, making it available for reuse.
staticrelease(Connection)release(+compound) - onewith_connection/1
Acquires a connection, calls Goal with the connection as argument, and releases the connection. The connection is released even if Goal fails or throws an exception.
staticwith_connection(Goal)with_connection(1)with_connection(+callable) - zero_or_morestats/1
Returns pool statistics as a compound term stats(Available, InUse, Total, MinSize, MaxSize).
staticstats(Stats)stats(-compound) - oneresize/2
Resizes the pool by setting new minimum and maximum sizes.
staticresize(MinSize,MaxSize)resize(+integer,+integer) - one_or_errorProtected predicates
(no local declarations; see entity ancestors if any)
Private predicates
pool_config/5
Stores the pool configuration parameters.
dynamicpool_config(Host,Port,MinSize,MaxSize,ConnectionOptions)pool_config(?atom,?integer,?integer,?integer,?list) - zero_or_oneavailable/1
Tracks connections that are available for use.
dynamicavailable(Connection)available(?compound) - zero_or_morein_use/2
Tracks connections currently in use along with their acquisition timestamp.
dynamicin_use(Connection,AcquireTimestamp)in_use(?compound,?compound) - zero_or_moreOperators
(none)