Class PollerOptions.Builder

  • Enclosing class:
    PollerOptions

    public static final class PollerOptions.Builder
    extends java.lang.Object
    • Method Detail

      • setMaximumPollRateIntervalMilliseconds

        public PollerOptions.Builder setMaximumPollRateIntervalMilliseconds​(int maximumPollRateIntervalMilliseconds)
        Defines interval for measuring poll rate. Larger the interval more spiky can be the load.
      • 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.