All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.lettuce.core.protocol.CompleteableCommand Maven / Gradle / Ivy

Go to download

Advanced and thread-safe Java Redis client for synchronous, asynchronous, and reactive usage. Supports Cluster, Sentinel, Pipelining, Auto-Reconnect, Codecs and much more.

The newest version!
package io.lettuce.core.protocol;

import java.util.function.BiConsumer;
import java.util.function.Consumer;

/**
 * Extension to commands that provide registration of command completion callbacks. Completion callbacks allow execution of
 * tasks after successive, failed or any completion outcome. A callback must be non-blocking. Callback registration gives no
 * guarantee over callback ordering.
 *
 * @author Mark Paluch
 */
public interface CompleteableCommand {

    /**
     * Register a command callback for successive command completion that notifies the callback with the command result.
     *
     * @param action must not be {@code null}.
     */
    void onComplete(Consumer action);

    /**
     * Register a command callback for command completion that notifies the callback with the command result or the failure
     * resulting from command completion.
     *
     * @param action must not be {@code null}.
     */
    void onComplete(BiConsumer action);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy