WaitStrategy class abstract
Abstract base class for all wait strategies.
Provides:
- Fluent builder methods (withStartupTimeout, withPollInterval,
withTransientExceptions) that return
thisfor chaining. - An adaptive poll loop that calls a supplied check function at most
once per pollInterval second, retrying until the deadline or until
the check returns
true.
Concrete subclasses must implement waitUntilReady.
Example:
final strategy = PortWaitStrategy(8080)
..withStartupTimeout(const Duration(seconds: 30))
..withPollInterval(const Duration(milliseconds: 500));
await strategy.waitUntilReady(container);
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- pollInterval ↔ Duration
-
Time between successive polling attempts.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startupTimeout ↔ Duration
-
Maximum time to wait for the container to become ready.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
poll(
Future< bool> check(), {List<Type> ? transientExceptions}) → Future<bool> - Adaptive polling loop.
-
toString(
) → String -
A string representation of this object.
inherited
-
waitUntilReady(
WaitStrategyTarget target) → Future< void> -
Waits until the container described by
targetis ready. -
withPollInterval(
Duration interval) → WaitStrategy - Sets the poll interval between readiness checks.
-
withStartupTimeout(
Duration timeout) → WaitStrategy - Sets the maximum startup timeout.
-
withTransientExceptions(
List< Type> exceptions) → WaitStrategy -
Adds
exceptionsto the set of exception types that are treated as transient failures during polling.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited