Package org.yamcs.api

Interface Observer<T>

All Known Subinterfaces:
DataObserver<T>
All Known Implementing Classes:
CallObserver, ClientStreamingObserver, ResponseObserver, ServerStreamingObserver, SubscribeParameterObserver, WebSocketObserver

public interface Observer<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Mark the successful end.
    default void
    complete(T message)
    Shortcut for:
    void
    Complete with an exception.
    default boolean
    Returns whether this call has been cancelled by the remote peer
    void
    next(T message)
    Emit the next message.
    default void
    setCancelHandler(Runnable cancelHandler)
    Set a Runnable that will be called when the call is cancelled.
  • Method Details

    • next

      void next(T message)
      Emit the next message.
    • completeExceptionally

      void completeExceptionally(Throwable t)
      Complete with an exception.
    • complete

      void complete()
      Mark the successful end.
    • complete

      default void complete(T message)
      Shortcut for:
       next(message);
       complete();
       
    • isCancelled

      default boolean isCancelled()
      Returns whether this call has been cancelled by the remote peer
    • setCancelHandler

      default void setCancelHandler(Runnable cancelHandler)
      Set a Runnable that will be called when the call is cancelled. (example: peer disconnect)