Package io.temporal.internal.worker
Class PollerOptions.Builder
- java.lang.Object
-
- io.temporal.internal.worker.PollerOptions.Builder
-
- Enclosing class:
- PollerOptions
public static final class PollerOptions.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PollerOptions
build()
PollerOptions.Builder
setBackoffCoefficient(double backoffCoefficient)
Coefficient to use when calculating exponential delay in case of failuresPollerOptions.Builder
setBackoffCongestionInitialInterval(java.time.Duration backoffCongestionInitialInterval)
Initial delay in case of congestion-related failures (i.e.PollerOptions.Builder
setBackoffInitialInterval(java.time.Duration backoffInitialInterval)
Initial delay in case of regular failure.PollerOptions.Builder
setBackoffMaximumInterval(java.time.Duration backoffMaximumInterval)
Maximum interval between polls in case of failures.PollerOptions.Builder
setBackoffMaximumJitterCoefficient(double backoffMaximumJitterCoefficient)
Maximum amount of jitter to apply.PollerOptions.Builder
setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds)
Defines interval for measuring poll rate.PollerOptions.Builder
setMaximumPollRatePerSecond(double maximumPollRatePerSecond)
Maximum rate of polling.PollerOptions.Builder
setPollThreadCount(int pollThreadCount)
Number of parallel polling threads.PollerOptions.Builder
setPollThreadNamePrefix(java.lang.String pollThreadNamePrefix)
Prefix to use when naming poller threads.PollerOptions.Builder
setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Called to report unexpected exceptions in the poller threads.
-
-
-
Method Detail
-
setMaximumPollRateIntervalMilliseconds
public PollerOptions.Builder setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds)
Defines interval for measuring poll rate. Larger the interval more spiky can be the load.
-
setMaximumPollRatePerSecond
public PollerOptions.Builder setMaximumPollRatePerSecond(double maximumPollRatePerSecond)
Maximum rate of polling. Measured in the interval set throughsetMaximumPollRateIntervalMilliseconds(int)
.
-
setBackoffCoefficient
public PollerOptions.Builder setBackoffCoefficient(double backoffCoefficient)
Coefficient to use when calculating exponential delay in case of failures
-
setBackoffInitialInterval
public PollerOptions.Builder setBackoffInitialInterval(java.time.Duration backoffInitialInterval)
Initial delay in case of regular failure. If backoff coefficient is 1 then it would be the constant delay between failing polls.
-
setBackoffCongestionInitialInterval
public PollerOptions.Builder setBackoffCongestionInitialInterval(java.time.Duration backoffCongestionInitialInterval)
Initial delay in case of congestion-related failures (i.e. RESOURCE_EXHAUSTED errors). If backoff coefficient is 1 then it would be the constant delay between failing polls.
-
setBackoffMaximumInterval
public PollerOptions.Builder setBackoffMaximumInterval(java.time.Duration backoffMaximumInterval)
Maximum interval between polls in case of failures.
-
setBackoffMaximumJitterCoefficient
public PollerOptions.Builder setBackoffMaximumJitterCoefficient(double backoffMaximumJitterCoefficient)
Maximum amount of jitter to apply. 0.2 means that actual retry time can be +/- 20% of the calculated time. Set to 0 to disable jitter. Must be lower than 1. Default is 0.1.
-
setPollThreadCount
public PollerOptions.Builder setPollThreadCount(int pollThreadCount)
Number of parallel polling threads.
-
setUncaughtExceptionHandler
public PollerOptions.Builder setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Called to report unexpected exceptions in the poller threads.
-
setPollThreadNamePrefix
public PollerOptions.Builder setPollThreadNamePrefix(java.lang.String pollThreadNamePrefix)
Prefix to use when naming poller threads.
-
build
public PollerOptions build()
-
-