Class WatcherRequest<T>

java.lang.Object
com.linecorp.centraldogma.client.WatcherRequest<T>

public final class WatcherRequest<T> extends Object
Prepares to create a Watcher.
  • Method Details

    • map

      public <U> WatcherRequest<U> map(Function<? super T,? extends U> mapper)
      Sets the Function to apply to the result of a watch request.
    • mapperExecutor

      public WatcherRequest<T> mapperExecutor(Executor executor)
      Sets the Executor to execute the map(Function).
    • delayOnSuccess

      public WatcherRequest<T> delayOnSuccess(Duration delayOnSuccess)
      Sets the delay for sending the next watch request when the previous request succeeds.
    • delayOnSuccessMillis

      public WatcherRequest<T> delayOnSuccessMillis(long delayOnSuccessMillis)
      Sets the delay in milliseconds for sending the next watch request when the previous request succeeds.
    • backoffOnFailure

      public WatcherRequest<T> backoffOnFailure(long initialDelayMillis, long maxDelayMillis, double multiplier)
      Sets the delays and multiplier which is used to calculate the delay for sending the next watch request when the previous request fails. Currently, it uses exponential backoff. File a feature request if you need another algorithm.
    • jitterRate

      public WatcherRequest<T> jitterRate(double jitterRate)
      Sets the jitter to apply the delay.
    • timeout

      public WatcherRequest<T> timeout(Duration timeout)
    • timeoutMillis

      public WatcherRequest<T> timeoutMillis(long timeoutMillis)
    • errorOnEntryNotFound

      public WatcherRequest<T> errorOnEntryNotFound(boolean errorOnEntryNotFound)
      Sets whether to throw an EntryNotFoundException if the watch target does not exist.
    • start

      public Watcher<T> start()
      Creates a new Watcher and starts to watch the target. The Watcher must be closed via Watcher.close() after use.