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.
      • setPollBackoffCoefficient

        public PollerOptions.Builder setPollBackoffCoefficient​(double pollBackoffCoefficient)
        Coefficient to use when calculating exponential delay in case of failures
      • setPollBackoffInitialInterval

        public PollerOptions.Builder setPollBackoffInitialInterval​(java.time.Duration pollBackoffInitialInterval)
        Initial delay in case of failure. If backoff coefficient is 1 then it would be the constant delay between failing polls.
      • setPollBackoffMaximumInterval

        public PollerOptions.Builder setPollBackoffMaximumInterval​(java.time.Duration pollBackoffMaximumInterval)
        Maximum interval between polls in case of failures.
      • 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.
      • setPollOnlyIfExecutorHasCapacity

        public PollerOptions.Builder setPollOnlyIfExecutorHasCapacity​(boolean pollOnlyIfExecutorHasCapacity)
        The poller will check task executor's remaining capacity before polling tasks. This is to prevent task to get started but not being able to execute in time.