- Companion:
- class
Value members
Concrete methods
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.
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 of the specified fixed size. The pool is returned in a
Managed
, which governs the lifetime of the pool. When the pool is
shutdown because the Managed
is used, the individual items allocated by
the pool will be released in some unspecified order.
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 pool is
shutdown because the Managed
is used, the individual items allocated by
the pool will be released in some unspecified order.
Makes a new pool with the specified minimum and maximum sizes and time to
live before a pool whose excess items are not being used will be shrunk
down to the minimum size. The pool is returned in a Managed
, which
governs the lifetime of the pool. When the pool is shutdown because the
Managed
is used, the individual items allocated by the pool will be
released in some unspecified order.
Makes a new pool with the specified minimum and maximum sizes and time to
live before a pool whose excess items are not being used will be shrunk
down to the minimum size. The pool is returned in a Managed
, which
governs the lifetime of the pool. When the pool is shutdown because the
Managed
is used, the individual items allocated by the pool will be
released in some unspecified order.
ZPool.make(acquireDbConnection, 10 to 20, 60.seconds).use { pool =>
pool.get.use {
connection => useConnection(connection)
}
}