Class PollerOptions.Builder
java.lang.Object
io.temporal.internal.worker.PollerOptions.Builder
-
Method Summary
Modifier and TypeMethodDescriptionbuild()setBackoffCoefficient(double backoffCoefficient) Coefficient to use when calculating exponential delay in case of failuressetBackoffCongestionInitialInterval(Duration backoffCongestionInitialInterval) Initial delay in case of congestion-related failures (i.e.setBackoffInitialInterval(Duration backoffInitialInterval) Initial delay in case of regular failure.setBackoffMaximumInterval(Duration backoffMaximumInterval) Maximum interval between polls in case of failures.setBackoffMaximumJitterCoefficient(double backoffMaximumJitterCoefficient) Maximum amount of jitter to apply.setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds) Defines interval for measuring poll rate.setMaximumPollRatePerSecond(double maximumPollRatePerSecond) Maximum rate of polling.setPollerBehavior(PollerBehavior pollerBehavior) Set poller behavior.setPollerTaskExecutorOverride(ExecutorService overrideTaskExecutor) Override the task executor ExecutorServicesetPollThreadNamePrefix(String pollThreadNamePrefix) Prefix to use when naming poller threads.setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtExceptionHandler) Called to report unexpected exceptions in the poller threads.setUsingVirtualThreads(boolean usingVirtualThreads) Use virtual threads polling threads.
-
Method Details
-
setMaximumPollRateIntervalMilliseconds
public PollerOptions.Builder setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds) Defines interval for measuring poll rate. Larger the interval more spiky can be the load. -
setMaximumPollRatePerSecond
Maximum rate of polling. Measured in the interval set throughsetMaximumPollRateIntervalMilliseconds(int). -
setBackoffCoefficient
Coefficient to use when calculating exponential delay in case of failures -
setBackoffInitialInterval
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(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
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. -
setPollerBehavior
Set poller behavior. -
setUncaughtExceptionHandler
public PollerOptions.Builder setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtExceptionHandler) Called to report unexpected exceptions in the poller threads. -
setPollThreadNamePrefix
Prefix to use when naming poller threads. -
setUsingVirtualThreads
Use virtual threads polling threads. -
setPollerTaskExecutorOverride
Override the task executor ExecutorService -
build
-