Execute the given computation when the count of this latch has reached zero.
Decrement the latch.
Decrement the latch. If the latch's count reaches zero, awaiting computations are executed serially.
the latch's count after being decremented
the latch's current count
Increment the latch.
Increment the latch. Computations passed to await
will not be executed
until the latch's count returns to zero.
the latch's count after being incremented
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
.