on dev help sign in
comment
commit5ee711622640cabfcd88365482bd0e847f449feb authorEitan Chatav <eitan@Eitans-MacBook-Pro.local> dateSun 23 Jun 2019, 21:29 (7 years ago) parent6d9f03f
1 file changed+10
squeal-postgresql/src/Squeal/PostgreSQL/Pool.hs+10
squeal-postgresql/src/Squeal/PostgreSQL/Pool.hs+10
@@ -82,6 +82,16 @@ createConnectionPool
8282createConnectionPool conninfo stripes idle maxResrc =
8383 createPool (connectdb conninfo) finish stripes idle maxResrc
8484
85+{-|
86+Temporarily take a connection from a `Pool`, perform an action with it,
87+and return it to the pool afterwards.
88+
89+If the pool has an idle connection available, it is used immediately.
90+Otherwise, if the maximum number of connections has not yet been reached,
91+a new connection is created and used.
92+If the maximum number of connections has been reached, this function blocks
93+until a connection becomes available.
94+-}
8595usingConnectionPool
8696 :: MonadUnliftIO io
8797 => Pool (K Connection schemas) -- ^ pool