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

io.lettuce.core.output.StreamingOutput 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.output;

import java.util.Collection;

/**
 * Implementors of this class support a streaming {@link CommandOutput} while the command is still processed. The receiving
 * {@link Subscriber} receives {@link Subscriber#onNext(Collection, Object)} calls while the command is active.
 *
 * @author Mark Paluch
 * @since 4.2
 */
public interface StreamingOutput {

    /**
     * Sets the {@link Subscriber}.
     *
     * @param subscriber
     */
    void setSubscriber(Subscriber subscriber);

    /**
     * Retrieves the {@link Subscriber}.
     *
     * @return
     */
    Subscriber getSubscriber();

    /**
     * Subscriber to a {@link StreamingOutput}.
     *
     * @param 
     */
    abstract class Subscriber {

        /**
         * Data notification sent by the {@link StreamingOutput}.
         *
         * @param t element
         */
        public abstract void onNext(T t);

        /**
         * Data notification sent by the {@link StreamingOutput}.
         *
         * @param outputTarget target
         * @param t element
         */
        public void onNext(Collection outputTarget, T t) {
            onNext(t);
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy