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

tech.ydb.topic.write.AsyncWriter Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package tech.ydb.topic.write;

import java.util.concurrent.CompletableFuture;

import tech.ydb.topic.settings.SendSettings;

/**
 * @author Nikolay Perfilov
 */
public interface AsyncWriter {

    /**
     * Initialize internal threads in the background. Non-blocking
     * @return {@link CompletableFuture} with {@link InitResult} containing initialization data like lastSeqNo
     */
    CompletableFuture init();

    /**
     * Send message. Non-blocking
     * @param message message data to write
     * @return {@link CompletableFuture} with {@link WriteAck} for write acknowledgement
     */
    CompletableFuture send(Message message) throws QueueOverflowException;

    /**
     * Send message. Non-blocking
     * @param message message data to write
     * @param settings send settings
     * @return {@link CompletableFuture} with {@link WriteAck} for write acknowledgement
     */
    CompletableFuture send(Message message, SendSettings settings) throws QueueOverflowException;

    /**
     * Stops internal threads and makes cleanup in background. Non-blocking
     */
    CompletableFuture shutdown();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy