NAME

DBIO::PostgreSQL::Async::Pool - EV::Pg connection pool for DBIO

VERSION

version 0.900000

SYNOPSIS

my $pool = DBIO::PostgreSQL::Async::Pool->new(
    conninfo => 'dbname=myapp',
    size     => 10,
    on_error => sub { warn $_[0] },
);

my $pg = $pool->acquire;       # get idle connection
$pool->release($pg);           # return to pool
my $pg = $pool->acquire_txn;   # pinned for transaction

DESCRIPTION

Connection pool for DBIO::PostgreSQL::Async::Storage. Manages a pool of EV::Pg connections, dispatching queries to available connections and queuing when all are busy.

The acquire / release / capacity / shutdown mechanics are inherited from DBIO::Storage::PoolBase; this class supplies only the EV::Pg seam — see "_create_connection", "_shutdown_connection" and "_transform_conninfo".

METHODS

_create_connection

Builds one EV::Pg connection from the (already-transformed) connect info. The pool tracks the returned connection — do not push it onto "_connections" yourself.

_shutdown_connection

Closes one EV::Pg connection during "shutdown" in DBIO::Storage::PoolBase. Errors are swallowed by the caller.

_transform_conninfo

Renders the stored connect info as a libpq conninfo string via "conninfo_string" in DBIO::PostgreSQL::Async::ConnectInfo. Accepts a hashref, arrayref, or string and returns a single conninfo string.

AUTHOR

DBIO Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.