
org.yamcs.api.Observer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yamcs-api Show documentation
Show all versions of yamcs-api Show documentation
Used by external clients to communicate with Yamcs
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