Class SchedulerExtensions

public static class SchedulerExtensions

Extension methods for IScheduler.

Inheritance

Object > SchedulerExtensions

Namespace

Google.Api.Gax

Assembly

Google.Api.Gax.dll

Methods

Sleep(IScheduler, TimeSpan, CancellationToken)

public static void Sleep(this IScheduler scheduler, TimeSpan delay, CancellationToken cancellationToken)

Simulates a synchronous delay by calling Delay(TimeSpan, CancellationToken) on scheduler, and unwrapping any exceptions generated (typically cancellation).

Parameters
TypeNameDescription
ISchedulerscheduler

The scheduler to use for the sleep operation.

TimeSpandelay

Time to sleep for. Must not be negative.

CancellationTokencancellationToken

The cancellation token that will be watched during the sleep operation.

Exceptions
TypeCondition
OperationCanceledException

The cancellation token was cancelled during the sleep.