Class NoOpScheduler (4.2.0)

public sealed class NoOpScheduler : IScheduler

An implementation of IScheduler that doesn't actually delay. This is useful for tests which aren't interested in precise timing, but just want to be able to use a scheduler. For more fine-grained control, use FakeScheduler.

Inheritance

Object > NoOpScheduler

Implements

IScheduler

Namespace

Google.Api.Gax.Testing

Assembly

Google.Api.Gax.Testing.dll

Methods

Delay(TimeSpan, CancellationToken)

public async Task Delay(TimeSpan delay, CancellationToken cancellationToken)

Returns a task that will complete "nearly immediately": there's no set delay, but the task yields before completing, avoiding synchronous execution leading to subtle bugs. The cancellation token passed in is observed, causing an exception if it's already canceled.

Parameters
NameDescription
delayTimeSpan

The theoretical delay, ignored by this implementation.

cancellationTokenCancellationToken

A cancellation token which is checked in the returned task.

Returns
TypeDescription
Task

A task that will complete immediately after yielding.