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

software.amazon.awssdk.eventstreamrpc.StreamEventPublisher Maven / Gradle / Ivy

There is a newer version: 1.21.0
Show newest version
/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

/* This file is part of greengrass-ipc project. */

package software.amazon.awssdk.eventstreamrpc;

import software.amazon.awssdk.eventstreamrpc.model.EventStreamJsonMessage;

import java.util.concurrent.CompletableFuture;

/**
 * Interface to enable sending events over an open stream operation.
 *
 * @param  Data to push over the open stream
 */
public interface StreamEventPublisher {
    /**
     * Publish an event over an open stream operation.
     *
     * @param streamEvent event to publish
     * @return Completable future indicating flush of the event over the stream
     */
    public CompletableFuture sendStreamEvent(final StreamEventType streamEvent);

    /**
     * Closes the stream by sending an empty message
     *
     * @return Completable future indicating flush of the stream termination message
     */
    public CompletableFuture closeStream();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy