NAME

DBIO::MySQL::Async::Pool - EV::MariaDB connection pool for DBIO

VERSION

version 0.900000

SYNOPSIS

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

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

DESCRIPTION

Connection pool for DBIO::MySQL::Async::Storage. Manages a pool of EV::MariaDB 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::MariaDB seam — see "_create_connection" and "_shutdown_connection".

METHODS

_create_connection

Builds one EV::MariaDB connection from the (already-transformed) connect info. Accepts a hashref of EV::MariaDB named parameters or a plain string (passed as the conninfo argument). The pool tracks the returned connection — do not push it onto "_connections" yourself.

_shutdown_connection

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

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.