ZPool

object ZPool
Companion:
class
class Object
trait Matchable
class Any
ZPool.type

Value members

Concrete methods

def fromIterable[A](iterable: => Iterable[A]): UManaged[ZPool[Nothing, A]]

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.

def make[R, E, A](get: ZManaged[R, E, A], size: => Int): URManaged[R, ZPool[E, A]]

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.

def make[R, E, A](get: ZManaged[R, E, A], range: => Range, timeToLive: => Duration): ZManaged[R & Clock, Nothing, ZPool[E, A]]

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)
 }
}