public interface RCountDownLatchRx extends RObjectRx
CountDownLatch
It has an advantage over CountDownLatch
--
count can be set via trySetCount(long)
method.Modifier and Type | Method and Description |
---|---|
io.reactivex.Completable |
await()
Waits until counter reach zero.
|
io.reactivex.Single<Boolean> |
await(long waitTime,
TimeUnit unit)
Waits until counter reach zero or up to defined
timeout . |
io.reactivex.Completable |
countDown()
Decrements the counter of the latch.
|
io.reactivex.Single<Long> |
getCount()
Returns value of current count.
|
io.reactivex.Single<Boolean> |
trySetCount(long count)
Sets new count value only if previous count already has reached zero
or is not set at all.
|
addListener, copy, delete, dump, getCodec, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
io.reactivex.Completable await()
io.reactivex.Single<Boolean> await(long waitTime, TimeUnit unit)
timeout
.waitTime
- the maximum time to waitunit
- the time unittrue
if the count reached zero and false
if timeout reached before the count reached zeroio.reactivex.Completable countDown()
io.reactivex.Single<Long> getCount()
io.reactivex.Single<Boolean> trySetCount(long count)
count
- - number of times countDown
must be invoked
before threads can pass through await
true
if new count setted
false
if previous count has not reached zeroCopyright © 2014–2020 Redisson. All rights reserved.