net.sf.asyncobjects.asyncscala.util

ASemaphore

trait ASemaphore extends Asynchronous

A classical semaphore that allows acquiring, reducing, and releasing permits. The acquire and reduce operations are ordered, the next operation starts executing only if previously received one has completed, so the semaphore behaves fairly with respect to these methods. The release operation is executed as soon as it is received, possibly resuming waiting acquire and reduce operations.

Linear Supertypes
Asynchronous, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ASemaphore
  2. Asynchronous
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Abstract Value Members

  1. def acquire (amount: Int): Promise[Unit]

    Acquire the specified amount of permits.

    Acquire the specified amount of permits. The operation waits until the specified amount of permits will be available, after that the amount of available permits is increased by the specified amount.

    amount

    the amount or permits requested

    returns

    a promise that resolves when permits are taken

    Attributes
    abstract
  2. def reduce (amount: Int): Promise[Unit]

    Reduce the amount of available permits by the specified amount.

    Reduce the amount of available permits by the specified amount. This operation does not waits until the amount of permits is available, but it waits until all previously registered acquire and reduce requests are processed. Using negative permits it is possible to track some some interesting conditions like amount of started worker operations.

    amount

    the amount or permits requested

    returns

    a promise that resolves when permits are taken

    Attributes
    abstract
  3. def release (amount: Int): Promise[Unit]

    Release the specified amount of permits.

    Release the specified amount of permits. If there are waiting acquire and reduce operations, they are resumed if the specified amount of permits allows it.

    amount

    the amount or permits released

    returns

    a promise that resolves when permits are released

    Attributes
    abstract

Concrete Value Members

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

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

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

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

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

    Attributes
    final
    Definition Classes
    Any
  6. def acquire : Promise[Unit]

    The variant of acquire operation that takes a single permit

    The variant of acquire operation that takes a single permit

    returns

    a promise that resolve when permit is acquired

  7. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  8. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  10. def equals (arg0: Any): Boolean

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  13. def hashCode (): Int

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  16. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  17. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  18. def reduce (): Promise[Unit]

    Reduce by one permit

    Reduce by one permit

    returns

    a promise that resolve when permit is reduced

  19. def release (): Promise[Unit]

    release a single permit

    release a single permit

    returns

    a promise that resolves when a permit is released

  20. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  21. def toString (): String

    Definition Classes
    AnyRef → Any
  22. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Asynchronous

Inherited from AnyRef

Inherited from Any