com.github.mauricio.async.db.pool

SingleThreadedAsyncObjectPool

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
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

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

    factory
    configuration

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def availables: Traversable[T]

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. 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.

    returns

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

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

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

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

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

    item
    returns

    Definition Classes
    SingleThreadedAsyncObjectPoolAsyncObjectPool
  15. def hashCode(): Int

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

  17. def isClosed: Boolean

  18. def isFull: Boolean

  19. final def isInstanceOf[T0]: Boolean

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

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

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

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

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

    returns

    Definition Classes
    SingleThreadedAsyncObjectPoolAsyncObjectPool
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. 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
  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AsyncObjectPool[T]

Inherited from AnyRef

Inherited from Any

Ungrouped