public class RedissonCountDownLatch extends RedissonObject implements RCountDownLatch
CountDownLatch
It has a advantage over CountDownLatch --
count can be reset via trySetCount(long).codec, commandExecutor, name| Modifier | Constructor and Description |
|---|---|
protected |
RedissonCountDownLatch(CommandAsyncExecutor commandExecutor,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
await()
Waits until counter reach zero.
|
boolean |
await(long time,
TimeUnit unit)
Waits until counter reach zero or up to defined
timeout. |
RFuture<Void> |
awaitAsync()
Waits until counter reach zero.
|
RFuture<Boolean> |
awaitAsync(long waitTime,
TimeUnit unit)
Waits until counter reach zero or up to defined
timeout. |
void |
countDown()
Decrements the counter of the latch.
|
RFuture<Void> |
countDownAsync()
Decrements the counter of the latch.
|
RFuture<Boolean> |
deleteAsync()
Delete object in async mode
|
long |
getCount()
Returns value of current count.
|
RFuture<Long> |
getCountAsync()
Returns value of current count.
|
boolean |
trySetCount(long count)
Sets new count value only if previous count already has reached zero
or is not set at all.
|
RFuture<Boolean> |
trySetCountAsync(long count)
Sets new count value only if previous count already has reached zero
or is not set at all.
|
addListener, addListener, addListenerAsync, addListenerAsync, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenersAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkaddListenerAsync, copyAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsyncprotected RedissonCountDownLatch(CommandAsyncExecutor commandExecutor, String name)
public void await()
throws InterruptedException
RCountDownLatchawait in interface RCountDownLatchInterruptedException - if the current thread was interruptedpublic RFuture<Void> awaitAsync()
RCountDownLatchAsyncawaitAsync in interface RCountDownLatchAsyncpublic boolean await(long time,
TimeUnit unit)
throws InterruptedException
RCountDownLatchtimeout.await in interface RCountDownLatchtime - the maximum time to waitunit - the time unittrue if the count reached zero and false
if timeout reached before the count reached zeroInterruptedException - if the current thread was interruptedpublic RFuture<Boolean> awaitAsync(long waitTime, TimeUnit unit)
RCountDownLatchAsynctimeout.awaitAsync in interface RCountDownLatchAsyncwaitTime - the maximum time to waitunit - the time unittrue if the count reached zero and false
if timeout reached before the count reached zeropublic void countDown()
RCountDownLatchcountDown in interface RCountDownLatchpublic RFuture<Void> countDownAsync()
RCountDownLatchAsynccountDownAsync in interface RCountDownLatchAsyncpublic long getCount()
RCountDownLatchgetCount in interface RCountDownLatchpublic RFuture<Long> getCountAsync()
RCountDownLatchAsyncgetCountAsync in interface RCountDownLatchAsyncpublic boolean trySetCount(long count)
RCountDownLatchtrySetCount in interface RCountDownLatchcount - - number of times RCountDownLatch.countDown() must be invoked
before threads can pass through RCountDownLatch.await()true if new count setted
false if previous count has not reached zeropublic RFuture<Boolean> trySetCountAsync(long count)
RCountDownLatchAsynctrySetCountAsync in interface RCountDownLatchAsynccount - - number of times countDown must be invoked
before threads can pass through awaittrue if new count setted
false if previous count has not reached zeropublic RFuture<Boolean> deleteAsync()
RObjectAsyncdeleteAsync in interface RObjectAsyncdeleteAsync in class RedissonObjecttrue if object was deleted false if notCopyright © 2014–2020 Redisson. All rights reserved.