org.powerscala.concurrent

SimplePool

class SimplePool[T] extends Pool[T]

SimplePool offers defaults for most of Pool values and only really needs an implementation of create.

T

the item type in the pool.

Linear Supertypes
Pool[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SimplePool
  2. Pool
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SimplePool(initialSize: Int = 0, maximumSize: Int = Int.MaxValue, f: ⇒ T)

    initialSize

    the initial size, defaults to 0.

    maximumSize

    the maximum size, defaults to Int.MaxValue.

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

    Definition Classes
    Pool
  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def clone(): AnyRef

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

    Definition Classes
    Pool
  9. 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
    Definition Classes
    SimplePoolPool
  10. final def eq(arg0: AnyRef): Boolean

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

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

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

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

    Definition Classes
    AnyRef → Any
  15. val initialSize: Int

    the initial size, defaults to 0.

    the initial size, defaults to 0.

    Definition Classes
    SimplePoolPool
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. val maximumSize: Int

    the maximum size, defaults to Int.

    the maximum size, defaults to Int.MaxValue.

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

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

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

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

    Definition Classes
    Pool
  22. 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
    Definition Classes
    SimplePoolPool
  23. 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

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

    Definition Classes
    AnyRef
  25. def toString(): String

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

    Definition Classes
    Pool
  27. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Pool[T]

Inherited from AnyRef

Inherited from Any

Ungrouped