Interface PollInterval

All Known Implementing Classes:
FibonacciPollInterval, FixedPollInterval, IterativePollInterval

public interface PollInterval
A poll interval represents how often Awaitility will pause before reevaluating the supplied condition.

Note that the name "poll interval" is a bit misleading. It's actually a delay between two successive condition evaluations. I.e if the condition evaluation takes 5 ms and a fixed poll interval of 100 ms is used then the next condition evaluation will happen at (approximately) 105 ms. It's called PollInterval for historic reasons.

Since:
1.7.0
  • Method Summary

    Modifier and Type
    Method
    Description
    next(int pollCount, Duration previousDuration)
    Generate the next poll interval (Duration) based on the previous Duration and/or the poll count.
  • Method Details

    • next

      Duration next(int pollCount, Duration previousDuration)
      Generate the next poll interval (Duration) based on the previous Duration and/or the poll count. The first time the poll interval is called the poll delay is used as previousDuration. By default the poll delay is equal to Duration.ZERO.
      Parameters:
      pollCount - The number of times the condition has been polled (evaluated). Always a positive integer.
      previousDuration - The duration of the previously returned poll interval.
      Returns:
      The duration of the next poll interval