PartitionedAsyncObjectPool

com.github.mauricio.async.db.pool.PartitionedAsyncObjectPool
class PartitionedAsyncObjectPool[T](factory: ObjectFactory[T], configuration: PoolConfiguration, numberOfPartitions: Int) extends AsyncObjectPool[T]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Concise view

Value members

Concrete methods

def availables: Iterable[T]
def close: Future[AsyncObjectPool[T]]

Closes this pool and future calls to take will cause the scala.concurrent.Future to raise an com.github.mauricio.async.db.pool.PoolAlreadyTerminatedException.

Closes this pool and future calls to take will cause the scala.concurrent.Future to raise an com.github.mauricio.async.db.pool.PoolAlreadyTerminatedException.

Attributes

def giveBack(item: T): Future[AsyncObjectPool[T]]

Returns an object taken from the pool back to it. This object will become available for another client to use. If the object is invalid or can not be reused for some reason the scala.concurrent.Future returned will contain the error that prevented this object of being added back to the pool. The object is then discarded from the pool.

Returns an object taken from the pool back to it. This object will become available for another client to use. If the object is invalid or can not be reused for some reason the scala.concurrent.Future returned will contain the error that prevented this object of being added back to the pool. The object is then discarded from the pool.

Attributes

def inUse: Iterable[T]
protected def isClosed: Boolean
def queued: Iterable[Promise[T]]
def take: Future[T]

Returns an object from the pool to the callee with the returned future. If the pool can not create or enqueue requests it will fill the returned scala.concurrent.Future with an com.github.mauricio.async.db.pool.PoolExhaustedException.

Returns an object from the pool to the callee with the returned future. If the pool can not create or enqueue requests it will fill the returned scala.concurrent.Future with an com.github.mauricio.async.db.pool.PoolExhaustedException.

Attributes

Returns:

future that will eventually return a usable pool object.

Inherited methods

def use[A](f: T => Future[A])(implicit executionContext: ExecutionContext): Future[A]

Retrieve and use an object from the pool for a single computation, returning it when the operation completes.

Retrieve and use an object from the pool for a single computation, returning it when the operation completes.

Attributes

f

function that uses the object

Returns:

f wrapped with take and giveBack

Inherited from:
AsyncObjectPool