Class PollerOptions.Builder

java.lang.Object
io.temporal.internal.worker.PollerOptions.Builder
Enclosing class:
PollerOptions

public static final class PollerOptions.Builder extends Object
  • 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

      public PollerOptions.Builder setMaximumPollRatePerSecond(double maximumPollRatePerSecond)
      Maximum rate of polling. Measured in the interval set through setMaximumPollRateIntervalMilliseconds(int).
    • setBackoffCoefficient

      public PollerOptions.Builder setBackoffCoefficient(double backoffCoefficient)
      Coefficient to use when calculating exponential delay in case of failures
    • setBackoffInitialInterval

      public PollerOptions.Builder setBackoffInitialInterval(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(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(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.
    • setPollerBehavior

      public PollerOptions.Builder setPollerBehavior(PollerBehavior pollerBehavior)
      Set poller behavior.
    • setUncaughtExceptionHandler

      public PollerOptions.Builder setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
      Called to report unexpected exceptions in the poller threads.
    • setPollThreadNamePrefix

      public PollerOptions.Builder setPollThreadNamePrefix(String pollThreadNamePrefix)
      Prefix to use when naming poller threads.
    • setUsingVirtualThreads

      public PollerOptions.Builder setUsingVirtualThreads(boolean usingVirtualThreads)
      Use virtual threads polling threads.
    • setPollerTaskExecutorOverride

      public PollerOptions.Builder setPollerTaskExecutorOverride(ExecutorService overrideTaskExecutor)
      Override the task executor ExecutorService
    • build

      public PollerOptions build()