WaitUntilSucceededAsync(Func<CancellationToken, Task<bool>>, TimeSpan, TimeSpan?, CancellationToken)
static
public static Task<bool> WaitUntilSucceededAsync(Func<CancellationToken, Task<bool>> predicate, TimeSpan timeout, TimeSpan? delayOnFail = null, CancellationToken cancellationToken = default(CancellationToken))Runs the predicate until it succeeds or the monotonic deadline expires.
Parameters
predicateFunc<CancellationToken, Task<bool>>- The predicate to run. The token is cancelled when the deadline expires or cancellation is requested.
timeoutTimeSpan- The timeout value.
delayOnFailTimeSpan?- The delay before retrying after an unsuccessful attempt.
cancellationTokenCancellationToken- The cancellation token.
Returns
true if the predicate succeeded before the deadline; otherwise, false.