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
.
- Alphabetic
- By Inheritance
- AsyncLatch
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
await(f: ⇒ Unit): Unit
Execute the given computation when the count of this latch has reached zero.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
decr(): Int
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
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getCount: Int
- returns
the latch's current count
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
incr(): Int
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
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()