Class AsyncCommand<K,​V,​T>

    • Constructor Detail

      • AsyncCommand

        public AsyncCommand​(RedisCommand<K,​V,​T> command)
        Parameters:
        command - the command, must not be null.
      • AsyncCommand

        protected AsyncCommand​(RedisCommand<K,​V,​T> command,
                               int count)
        Parameters:
        command - the command, must not be null.
    • Method Detail

      • await

        public boolean await​(long timeout,
                             TimeUnit unit)
        Wait up to the specified time for the command output to become available.
        Specified by:
        await in interface RedisFuture<K>
        Parameters:
        timeout - Maximum time to wait for a result.
        unit - Unit of time for the timeout.
        Returns:
        true if the output became available.
      • getOutput

        public CommandOutput<K,​V,​T> getOutput()
        Get the object that holds this command's output.
        Specified by:
        getOutput in interface RedisCommand<K,​V,​T>
        Returns:
        The command output object.
      • complete

        public void complete()
        Mark this command complete and notify all waiting threads.
        Specified by:
        complete in interface RedisCommand<K,​V,​T>
      • completeResult

        protected void completeResult()
      • getError

        public String getError()
        Specified by:
        getError in interface RedisFuture<K>
        Returns:
        error text, if any error occurred.
      • cancel

        public void cancel()
        Description copied from interface: RedisCommand
        Attempts to cancel execution of this command. This attempt will fail if the task has already completed, has already been cancelled, or could not be cancelled for some other reason.
        Specified by:
        cancel in interface RedisCommand<K,​V,​T>
      • encode

        public void encode​(ByteBuf buf)
        Description copied from interface: RedisCommand
        Encode the command.
        Specified by:
        encode in interface RedisCommand<K,​V,​T>
        Parameters:
        buf - byte buffer to operate on.
      • setOutput

        public void setOutput​(CommandOutput<K,​V,​T> output)
        Description copied from interface: RedisCommand
        Set a new output. Only possible as long as the command is not completed/cancelled.
        Specified by:
        setOutput in interface RedisCommand<K,​V,​T>
        Parameters:
        output - the new command output
      • onComplete

        public void onComplete​(Consumer<? super T> action)
        Description copied from interface: CompleteableCommand
        Register a command callback for successive command completion that notifies the callback with the command result.
        Specified by:
        onComplete in interface CompleteableCommand<K>
        Parameters:
        action - must not be null.
      • onComplete

        public void onComplete​(BiConsumer<? super T,​Throwable> action)
        Description copied from interface: CompleteableCommand
        Register a command callback for command completion that notifies the callback with the command result or the failure resulting from command completion.
        Specified by:
        onComplete in interface CompleteableCommand<K>
        Parameters:
        action - must not be null.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object