Skip to main content

AsyncMysqlConnectionPool

Note

This is a point-in-time snapshot of the API documentation from January 2026. Going forward, we will not be maintaining a public copy of these references, and recommend users to refer to the built-in signature helpers available in the Hack LSP instead for complete and up-to-date information.

An asynchronous MySQL connection pool

This class provides a mechanism to create a pool of connections to a MySQL client that can be utilized and reused as needed.

When a client requests a connection from the pool, it may get one that already exists; this avoids the overhead of establishing a new connection.

This is the highly recommended way to create connections to a MySQL client, as opposed to using the AsyncMysqlClient class which does not give you nearly the flexibility. In fact, there is discussion about deprecating the AsyncMysqlClient class all together.

Guides

Interface Synopsis

class AsyncMysqlConnectionPool {...}

Public Methods