Creates a pool from a fixed number of pre-allocated items.
Creates a pool from a fixed number of pre-allocated items. This method
should only be used when there is no cleanup or release operation
associated with items in the pool. If cleanup or release is required,
then the make constructor should be used instead.
Makes a new pool with the specified minimum and maximum sizes.
Makes a new pool with the specified minimum and maximum sizes. The pool is
returned in a Managed, which governs the lifetime of the pool. When the
pull is shutdown because the Managed is used, the individual items
allocated by the pool will be released in some unspecified order.
for { pool <- ZPool.make(acquireDbConnection, 10 to 20) _ <- pool.use { pool => pool.get.use { connection => useConnection(connection) } } } yield ()
Makes a new pool of the specified fixed size.
Makes a new pool of the specified fixed size. The pool is returned in a
Managed, which governs the lifetime of the pool. When the pull is
shutdown because the Managed is used, the individual items allocated by
the pool will be released in some unspecified order.