Packages

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

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def availables: Iterable[T]
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. 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.

    Definition Classes
    SingleThreadedAsyncObjectPoolAsyncObjectPool
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Definition Classes
    SingleThreadedAsyncObjectPool → AnyRef
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def giveBack(item: T): Future[AsyncObjectPool[T]]

    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
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def inUse: Iterable[T]
  15. def isClosed: Boolean
  16. def isFull: Boolean
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. def queued: Iterable[Promise[T]]
  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. def take: Future[T]

    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
    Definition Classes
    AnyRef → Any
  25. 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.

    f

    function that uses the object

    returns

    f wrapped with take and giveBack

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

Inherited from AsyncObjectPool[T]

Inherited from AnyRef

Inherited from Any

Ungrouped