org.powerscala.concurrent

Pool

Related Docs: object Pool | package concurrent

trait Pool[T] extends AnyRef

Pool offers a fairly simplistic object pooling implementation.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Pool
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def createItem(): T

    Creates an item for use in the pool.

    Creates an item for use in the pool. This method is invoked internally and should never be externally exposed.

    Attributes
    protected
  2. abstract def disposeItem(t: T): Unit

    Called immediately before an item is disposed from the pool.

    Called immediately before an item is disposed from the pool. There is no requirement for this method to do anything, but allows for cleanup before this item is dumped from the pool.

    t

    the item being disposed.

    Attributes
    protected
  3. abstract def initialSize: Int

    The initial number of items that should be created in the pool.

  4. abstract def maximumSize: Int

    The maximum number of items that can exist in the pool.

  5. abstract def releaseItem(t: T): Unit

    Called immediately before an item is placed back into the pool.

    Called immediately before an item is placed back into the pool. There is no requirement for this method to do anything, but allows for cleanup before the item is recycled into the pool.

    t

    the item being released.

    Attributes
    protected

Concrete 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. def apply(): T

    Waits perpetually until an item is available in the pool and then returns it.

    Waits perpetually until an item is available in the pool and then returns it.

    returns

    T

  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def dispose(t: T): Unit

    Disposes the item and does not return it to the pool.

    Disposes the item and does not return it to the pool. This lets the pool know that a new item can be created to replace it. Calls disposeItem(t) before the item count is reduced to allow any cleanup necessary to occur.

    t

    the item to dispose.

  8. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

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

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

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

    Definition Classes
    AnyRef
  17. def release(t: T): Unit

    Releases the item back to the pool for re-use.

    Releases the item back to the pool for re-use. Calls releaseItem(t) before it is returned to the queue.

    t

    the item to return.

  18. def request(waitTime: Double = Double.MaxValue, create: Boolean = true): Option[T]

    Requests an item from the pool for use.

    Requests an item from the pool for use. Will block for waitTime for the availability of the item.

    waitTime

    the amount of time in seconds to wait for an available item from the pool. Defaults to Double.MaxValue.

    create

    if true an item will be added to the queue if there are no items available and the pool isn't fully utilized. Defaults to true.

    returns

    Some[T] if the pool is not fully utilized

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

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. def use[R](waitTime: Double = Double.MaxValue, create: Boolean = true)(f: (T) ⇒ R): Option[R]

    Use allows safe usage of an item with a guaranteed release back to the pool.

    Use allows safe usage of an item with a guaranteed release back to the pool. The supplied function will receive an an item when one becomes available (blocking) within waitTime. If waitTime elapses before an item becomes available then the function will not be invoked an None will be returned.

    R

    the return type of the function

    waitTime

    the amount of time to wait for an item to become available in the pool. Defaults to Double.MaxValue

    create

    if true an item will be added to the queue if there are no items available and the pool isn't fully utilized. Defaults to true.

    f

    the function to invoke with the item.

    returns

    Some[R] only if the function was able to successfully execute within the waitTime.

  22. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped