Class/Object

com.github.mauricio.async.db.pool

SingleThreadedAsyncObjectPool

Related Docs: object SingleThreadedAsyncObjectPool | package pool

Permalink

class SingleThreadedAsyncObjectPool[T] extends AsyncObjectPool[T]

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

Linear Supertypes
AsyncObjectPool[T], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SingleThreadedAsyncObjectPool
  2. AsyncObjectPool
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SingleThreadedAsyncObjectPool(factory: ObjectFactory[T], configuration: PoolConfiguration)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def availables: Traversable[T]

    Permalink
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def close: Future[AsyncObjectPool[T]]

    Permalink

    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.

    Definition Classes
    SingleThreadedAsyncObjectPoolAsyncObjectPool
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Definition Classes
    SingleThreadedAsyncObjectPool → AnyRef
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def giveBack(item: T): Future[AsyncObjectPool[T]]

    Permalink

    Returns an object to the pool.

    Returns an object to the pool. The object is validated before being added to the collection of available objects to make sure we have a usable object. If the object isn't valid it's discarded.

    Definition Classes
    SingleThreadedAsyncObjectPoolAsyncObjectPool
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. def inUse: Traversable[T]

    Permalink
  15. def isClosed: Boolean

    Permalink
  16. def isFull: Boolean

    Permalink
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. def queued: Traversable[Promise[T]]

    Permalink
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def take: Future[T]

    Permalink

    Asks for an object from the pool, this object should be returned to the pool when not in use anymore.

    Asks for an object from the pool, this object should be returned to the pool when not in use anymore.

    Definition Classes
    SingleThreadedAsyncObjectPoolAsyncObjectPool
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. def use[A](f: (T) ⇒ Future[A])(implicit executionContext: ExecutionContext): Future[A]

    Permalink

    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.

    f

    function that uses the object

    returns

    f wrapped with take and giveBack

    Definition Classes
    AsyncObjectPool
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AsyncObjectPool[T]

Inherited from AnyRef

Inherited from Any

Ungrouped