Interface WatchClient.Listener

Enclosing interface:
WatchClient

public static interface WatchClient.Listener
Interface for receiving WatchResponses.

Users should prefer to use WatchClient.UnitListener when applicable.

The main implementation for this interface is etcd's listener, which is backed by io.grpc.stub.StreamObserver. We are assuming the semantics of that interface.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invoked on completion.
    void
    onError(@NotNull Throwable throwable)
    Invoked on errors.
    void
    Invoked on new events.
    default void
    Notifies the client that the listener received the registration event.
  • Method Details

    • onRegistration

      default void onRegistration()
      Notifies the client that the listener received the registration event.
    • onNextWatchResponse

      void onNextWatchResponse(@NotNull @NotNull WatchResponse response)
      Invoked on new events.

      Can be called many times but is never called after onError(Throwable) or onCompleted() are called.

      Parameters:
      response - the response
    • onError

      void onError(@NotNull @NotNull Throwable throwable)
      Invoked on errors.

      May only be called once and if called it must be the last method called.

      Parameters:
      throwable - the error
    • onCompleted

      void onCompleted()
      Invoked on completion.

      May only be called once and if called it must be the last method called.