Package

com.github.mauricio.async.db

pool

Permalink

package pool

Visibility
  1. Public
  2. All

Type Members

  1. trait AsyncObjectPool[T] extends AnyRef

    Permalink

    Defines the common interface for async object pools.

    Defines the common interface for async object pools. These are pools that do not block clients trying to acquire a resource from it. Different than the usual synchronous pool, you **must** return objects back to it manually since it's impossible for the pool to know when the object is ready to be given back.

  2. class ConnectionPool[T <: Connection] extends SingleThreadedAsyncObjectPool[T] with Connection

    Permalink

    Pool specialized in database connections that also simplifies connection handling by implementing the com.github.mauricio.async.db.Connection trait and saving clients from having to implement the "give back" part of pool management.

    Pool specialized in database connections that also simplifies connection handling by implementing the com.github.mauricio.async.db.Connection trait and saving clients from having to implement the "give back" part of pool management. This lets you do your job without having to worry about managing and giving back connection objects to the pool.

    The downside of this is that you should not start transactions or any kind of long running process in this object as the object will be sent back to the pool right after executing a query. If you need to start transactions you will have to take an object from the pool, do it and then give it back manually.

  3. trait ObjectFactory[T] extends AnyRef

    Permalink

    Definition for objects that can be used as a factory for com.github.mauricio.async.db.pool.AsyncObjectPool objects.

    Definition for objects that can be used as a factory for com.github.mauricio.async.db.pool.AsyncObjectPool objects.

    T

    the kind of object this factory produces.

  4. class PartitionedAsyncObjectPool[T] extends AsyncObjectPool[T]

    Permalink
  5. class PartitionedConnectionPool[T <: Connection] extends PartitionedAsyncObjectPool[T] with Connection

    Permalink
  6. class PoolAlreadyTerminatedException extends IllegalStateException

    Permalink

    Thrown when the pool has already been closed.

  7. case class PoolConfiguration(maxObjects: Int, maxIdle: Long, maxQueueSize: Int, validationInterval: Long = 5000) extends Product with Serializable

    Permalink

    Defines specific pieces of a pool's behavior.

    Defines specific pieces of a pool's behavior.

    maxObjects

    how many objects this pool will hold

    maxIdle

    number of milliseconds for which the objects are going to be kept as idle (not in use by clients of the pool)

    maxQueueSize

    when there are no more objects, the pool can queue up requests to serve later then there are objects available, this is the maximum number of enqueued requests

    validationInterval

    pools will use this value as the timer period to validate idle objects.

  8. class PoolExhaustedException extends IllegalStateException

    Permalink

    Raised when a pool has reached it's limit of available objects.

  9. class SingleThreadedAsyncObjectPool[T] extends AsyncObjectPool[T]

    Permalink

    Implements an com.github.mauricio.async.db.pool.AsyncObjectPool using a single thread from a fixed executor service as an event loop to cause all calls to be sequential.

    Implements an com.github.mauricio.async.db.pool.AsyncObjectPool using a single thread from a fixed executor service as an event loop to cause all calls to be sequential.

    Once you are done with this object remember to call it's close method to clean up the thread pool and it's objects as this might prevent your application from ending.

    T

    type of the object this pool holds

  10. trait TimeoutScheduler extends AnyRef

    Permalink

Value Members

  1. object PoolConfiguration extends Serializable

    Permalink
  2. object SingleThreadedAsyncObjectPool

    Permalink

Ungrouped