Interface IScheduler (4.8.0)

public interface IScheduler

Abstraction of scheduler-like operations, used for testability.

Namespace

Google.Api.Gax

Assembly

Google.Api.Gax.dll

Remarks

Note that this is different to TaskScheduler, which is really involved with assigning tasks to threads rather than any sort of delay.

Methods

Delay(TimeSpan, CancellationToken)

Task Delay(TimeSpan delay, CancellationToken cancellationToken)

Returns a task which will complete after the given delay. Whether the returned awaitable is configured to capture the current context or not is implementation-specific. (A test implementation may capture the current context to enable reliable testing.)

Parameters
Name Description
delay TimeSpan

Time to delay for. Must not be negative.

cancellationToken CancellationToken

The cancellation token that will be checked prior to completing the returned task.

Returns
Type Description
Task

A task which will complete after the given delay.

Extension Method