Package org.redisson

Class RedissonCountDownLatch

    • Constructor Detail

      • RedissonCountDownLatch

        protected RedissonCountDownLatch​(CommandAsyncExecutor commandExecutor,
                                          name)
    • Method Detail

      • await

        public void await()
                   throws 
        Description copied from interface: RCountDownLatch
        Waits until counter reach zero.
        Specified by:
        await in interface RCountDownLatch
        Throws:
        - if the current thread was interrupted
      • await

        public boolean await​(long time,
                              unit)
                      throws 
        Description copied from interface: RCountDownLatch
        Waits until counter reach zero or up to defined timeout.
        Specified by:
        await in interface RCountDownLatch
        Parameters:
        time - the maximum time to wait
        unit - the time unit
        Returns:
        true if the count reached zero and false if timeout reached before the count reached zero
        Throws:
        - if the current thread was interrupted
      • awaitAsync

        public > awaitAsync​(long waitTime,
                                            unit)
        Description copied from interface: RCountDownLatchAsync
        Waits until counter reach zero or up to defined timeout.
        Specified by:
        awaitAsync in interface RCountDownLatchAsync
        Parameters:
        waitTime - the maximum time to wait
        unit - the time unit
        Returns:
        true if the count reached zero and false if timeout reached before the count reached zero
      • countDown

        public void countDown()
        Description copied from interface: RCountDownLatch
        Decrements the counter of the latch. Notifies all waiting threads when count reaches zero.
        Specified by:
        countDown in interface RCountDownLatch
      • countDownAsync

        public > countDownAsync()
        Description copied from interface: RCountDownLatchAsync
        Decrements the counter of the latch. Notifies all waiting threads when count reaches zero.
        Specified by:
        countDownAsync in interface RCountDownLatchAsync
        Returns:
        void
      • getCount

        public long getCount()
        Description copied from interface: RCountDownLatch
        Returns value of current count.
        Specified by:
        getCount in interface RCountDownLatch
        Returns:
        current count
      • trySetCount

        public boolean trySetCount​(long count)
        Description copied from interface: RCountDownLatch
        Sets new count value only if previous count already has reached zero or is not set at all.
        Specified by:
        trySetCount in interface RCountDownLatch
        Parameters:
        count - - number of times RCountDownLatch.countDown() must be invoked before threads can pass through RCountDownLatch.await()
        Returns:
        true if new count setted false if previous count has not reached zero
      • trySetCountAsync

        public > trySetCountAsync​(long count)
        Description copied from interface: RCountDownLatchAsync
        Sets new count value only if previous count already has reached zero or is not set at all.
        Specified by:
        trySetCountAsync in interface RCountDownLatchAsync
        Parameters:
        count - - number of times countDown must be invoked before threads can pass through await
        Returns:
        true if new count setted false if previous count has not reached zero