Class ProtoPolling

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

Shared bounded polling: repeatedly probes until the observation satisfies the predicate or the timeout elapses, returning the last observation and whether it was satisfied. The caller decides what a timeout means, so the same loop serves assertions, synchronization waits and readiness probes without owning their failure semantics.

public static class ProtoPolling
Inheritance
ProtoPolling
Inherited Members

Fields

DefaultInterval

The default interval between probes when a caller does not specify one.

public static readonly TimeSpan DefaultInterval

Field Value

TimeSpan

Methods

PollAsync<T>(Func<CancellationToken, ValueTask<T>>, Func<T, bool>, TimeSpan, TimeSpan, CancellationToken)

Probes until isSatisfied returns true or timeout elapses.

public static ValueTask<ProtoPollResult<T>> PollAsync<T>(Func<CancellationToken, ValueTask<T>> probe, Func<T, bool> isSatisfied, TimeSpan timeout, TimeSpan pollInterval, CancellationToken cancellationToken)

Parameters

probe Func<CancellationToken, ValueTask<T>>
isSatisfied Func<T, bool>
timeout TimeSpan
pollInterval TimeSpan
cancellationToken CancellationToken

Returns

ValueTask<ProtoPollResult<T>>

Type Parameters

T