Class

com.twitter.finagle.util

AsyncLatch

Related Doc: package util

Permalink

class AsyncLatch extends AnyRef

A construct providing latched, asynchronous execution of side-effecting functions. com.twitter.finagle.util.AsyncLatch#await does not block, but the execution of functions passed to it may be delayed. That is, because the latch guarantees serial, non-concurrent execution, functions passed to await may have to wait until both of the following conditions are met:

1. No other functions are being executed 2. The latch's count is zero

Thus, calling com.twitter.finagle.util.AsyncLatch#incr will cause subsequent functions passed to com.twitter.finagle.util.AsyncLatch#await to be delayed until the count is decremented to zero. Once the count is zero, functions are executed in LIFO order, i.e., the reverse of the order in which they are given to await.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AsyncLatch
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AsyncLatch(initialCount: Int = 0)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def await(f: ⇒ Unit): Unit

    Permalink

    Execute the given computation when the count of this latch has reached zero.

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def decr(): Int

    Permalink

    Decrement the latch.

    Decrement the latch. If the latch's count reaches zero, awaiting computations are executed serially.

    returns

    the latch's count after being decremented

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def getCount: Int

    Permalink

    returns

    the latch's current count

  13. def hashCode(): Int

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

    Permalink

    Increment the latch.

    Increment the latch. Computations passed to await will not be executed until the latch's count returns to zero.

    returns

    the latch's count after being incremented

  15. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped