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)