Class SchedulerExtensions (4.2.0)

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
NameDescription
schedulerIScheduler

The scheduler to use for the sleep operation.

delayTimeSpan

Time to sleep for. Must not be negative.

cancellationTokenCancellationToken

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

Exceptions
TypeDescription
OperationCanceledException

The cancellation token was cancelled during the sleep.