Class ProtoPolling
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
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
probeFunc<CancellationToken, ValueTask<T>>isSatisfiedFunc<T, bool>timeoutTimeSpanpollIntervalTimeSpancancellationTokenCancellationToken
Returns
Type Parameters
T