Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connection Pool

npm install @ferrow/connection-pool

CI

Reuse database/socket connections. Prevent resource exhaustion.

const pool = new ConnectionPool({ maxConnections: 10 }, factory);
const conn = await pool.acquire();
try { /* use connection */ } finally { pool.release(conn); }

The second constructor argument, factory, is a () => Promise<T> used to create new connections up to maxConnections. It is optional but acquire() throws once the pool is exhausted if no factory was provided to create additional connections.

Solves: Resource exhaustion, connection limits, performance. License: MIT

Sponsored by Ferrow


Part of the ferrow-toolkit collection · Sponsored by Ferrow

About

High-performance connection pooling for database and network connections

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages