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

org.yamcs.api.Observer Maven / Gradle / Ivy

There is a newer version: 5.10.9
Show newest version
package org.yamcs.api;

public interface Observer {

    /**
     * Emit the next message.
     */
    void next(T message);

    /**
     * Complete with an exception.
     */
    void completeExceptionally(Throwable t);

    /**
     * Mark the successful end.
     */
    void complete();

    /**
     * Shortcut for:
     * 
     * 
     * next(message);
     * complete();
     * 
*/ default void complete(T message) { next(message); complete(); } /** * Returns whether this call has been cancelled by the remote peer */ default boolean isCancelled() { return false; } /** * Set a {@link Runnable} that will be called when the call is cancelled. (example: peer disconnect) */ default void setCancelHandler(Runnable cancelHandler) { throw new UnsupportedOperationException(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy