Package org.redisson.api
Interface RCountDownLatchAsync
-
- All Superinterfaces:
RObjectAsync
- All Known Subinterfaces:
RCountDownLatch
- All Known Implementing Classes:
RedissonCountDownLatch
public interface RCountDownLatchAsync extends RObjectAsync
Async interface of Redis based It has an advantage over -- count can be set viatrySetCountAsync(long)
method.- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description >
awaitAsync()
Waits until counter reach zero.>
awaitAsync(long waitTime, unit)
Waits until counter reach zero or up to definedtimeout
.>
countDownAsync()
Decrements the counter of the latch.>
getCountAsync()
Returns value of current count.>
trySetCountAsync(long count)
Sets new count value only if previous count already has reached zero or is not set at all.-
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
-
-
-
Method Detail
-
awaitAsync
> awaitAsync()
Waits until counter reach zero.- Returns:
- void
-
awaitAsync
> awaitAsync(long waitTime, unit)
Waits until counter reach zero or up to definedtimeout
.- Parameters:
waitTime
- the maximum time to waitunit
- the time unit- Returns:
true
if the count reached zero andfalse
if timeout reached before the count reached zero
-
countDownAsync
> countDownAsync()
Decrements the counter of the latch. Notifies all waiting threads when count reaches zero.- Returns:
- void
-
getCountAsync
> getCountAsync()
Returns value of current count.- Returns:
- the current count
-
trySetCountAsync
> trySetCountAsync(long count)
Sets new count value only if previous count already has reached zero or is not set at all.- Parameters:
count
- - number of timescountDown
must be invoked before threads can pass throughawait
- Returns:
true
if new count settedfalse
if previous count has not reached zero
-
-