Package com.linecorp.centraldogma.client
Class WatcherRequest<T>
java.lang.Object
com.linecorp.centraldogma.client.WatcherRequest<T>
Prepares to create a
Watcher
.-
Method Summary
Modifier and TypeMethodDescriptionbackoffOnFailure
(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.delayOnSuccess
(Duration delayOnSuccess) Sets the delay for sending the next watch request when the previous request succeeds.delayOnSuccessMillis
(long delayOnSuccessMillis) Sets the delay in milliseconds for sending the next watch request when the previous request succeeds.errorOnEntryNotFound
(boolean errorOnEntryNotFound) Sets whether to throw anEntryNotFoundException
if the watch target does not exist.jitterRate
(double jitterRate) Sets the jitter to apply the delay.<U> WatcherRequest
<U> Sets theFunction
to apply to the result of a watch request.mapperExecutor
(Executor executor) Sets theExecutor
to execute themap(Function)
.start()
Creates a newWatcher
and starts to watch the target.timeoutMillis
(long timeoutMillis)
-
Method Details
-
map
Sets theFunction
to apply to the result of a watch request. -
mapperExecutor
Sets theExecutor
to execute themap(Function)
. -
delayOnSuccess
Sets the delay for sending the next watch request when the previous request succeeds. -
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
Sets the jitter to apply the delay. -
timeout
-
timeoutMillis
-
errorOnEntryNotFound
Sets whether to throw anEntryNotFoundException
if the watch target does not exist. -
start
Creates a newWatcher
and starts to watch the target. TheWatcher
must be closed viaWatcher.close()
after use.
-