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 PollerOptionsbuild()PollerOptions.BuildersetBackoffCoefficient(double backoffCoefficient)Coefficient to use when calculating exponential delay in case of failuresPollerOptions.BuildersetBackoffCongestionInitialInterval(java.time.Duration backoffCongestionInitialInterval)Initial delay in case of congestion-related failures (i.e.PollerOptions.BuildersetBackoffInitialInterval(java.time.Duration backoffInitialInterval)Initial delay in case of regular failure.PollerOptions.BuildersetBackoffMaximumInterval(java.time.Duration backoffMaximumInterval)Maximum interval between polls in case of failures.PollerOptions.BuildersetBackoffMaximumJitterCoefficient(double backoffMaximumJitterCoefficient)Maximum amount of jitter to apply.PollerOptions.BuildersetMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds)Defines interval for measuring poll rate.PollerOptions.BuildersetMaximumPollRatePerSecond(double maximumPollRatePerSecond)Maximum rate of polling.PollerOptions.BuildersetPollThreadCount(int pollThreadCount)Number of parallel polling threads.PollerOptions.BuildersetPollThreadNamePrefix(java.lang.String pollThreadNamePrefix)Prefix to use when naming poller threads.PollerOptions.BuildersetUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)Called to report unexpected exceptions in the poller threads.PollerOptions.BuildersetUsingVirtualThreads(boolean usingVirtualThreads)Use virtual threads polling 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.
-
setUsingVirtualThreads
public PollerOptions.Builder setUsingVirtualThreads(boolean usingVirtualThreads)
Use virtual threads polling threads.
-
build
public PollerOptions build()
-
-