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.1
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 */ boolean isCancelled(); /** * Set a {@link Runnable} that will be called when the call is cancelled. (example: peer disconnect) */ void setCancelHandler(Runnable cancelHandler); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy