Package org.redisson.api
Interface RCountDownLatchAsync
-
- All Superinterfaces:
RObjectAsync
- All Known Subinterfaces:
RCountDownLatch
- All Known Implementing Classes:
RedissonCountDownLatch
public interface RCountDownLatchAsync extends RObjectAsync
Distributed async implementation ofCountDownLatch
It has an advantage overCountDownLatch
-- count can be set viatrySetCountAsync(long)
method.- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RFuture<Void>
countDownAsync()
Decrements the count of the latch, releasing all waiting threads if the count reaches zero.RFuture<Long>
getCountAsync()
Returns the current count.RFuture<Boolean>
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
copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
-
-
-
Method Detail
-
countDownAsync
RFuture<Void> countDownAsync()
Decrements the count of the latch, releasing all waiting threads if the count reaches zero.If the current count is greater than zero then it is decremented. If the new count is zero then all waiting threads are re-enabled for thread scheduling purposes.
If the current count equals zero then nothing happens.
- Returns:
- void
-
getCountAsync
RFuture<Long> getCountAsync()
Returns the current count.This method is typically used for debugging and testing purposes.
- Returns:
- the current count
-
trySetCountAsync
RFuture<Boolean> 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
-
-