Attributes
Members list
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.
Attributes
Makes a new pool of the specified fixed size. The pool is returned in a Scope
, which governs the lifetime of the pool. When the pool is shutdown because the Scope
is closed, 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 Scope
, which governs the lifetime of the pool. When the pool is shutdown because the Scope
is closed, the individual items allocated by the pool will be released in some unspecified order.
Attributes
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 Scope
, which governs the lifetime of the pool. When the pool is shutdown because the Scope
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 Scope
, which governs the lifetime of the pool. When the pool is shutdown because the Scope
is used, the individual items allocated by the pool will be released in some unspecified order.
ZIO.scoped {
ZPool.make(acquireDbConnection, 10 to 20, 60.seconds).flatMap { pool =>
ZIO.scoped {
pool.get.flatMap {
connection => useConnection(connection)
}
}
}
}