Striped resource pooling for Haskell, such as database connection pools
open sourceBSD-3-Clausefree
resource-pool is a high-performance striped pool for Haskell that manages flexibly sized collections of resources such as database connections, built on QSem. Pools are configured with a creation and destruction action, a size, an idle timeout, stripe count and labels; its README asks library authors to accept a PoolConfig builder rather than wrap the settings themselves. Originally by Bryan O'Sullivan, it's maintained by Andrzej Rybczak under Scrive.
Problems it solves
- pool database connections in a Haskell web app
- limit concurrent connections to Postgres from Haskell
- reuse expensive resources across threads in Haskell
Features
- striped pools for less contention
- configurable size, idle timeout and stripes
- labels for pools
- any resource with create and destroy actions
