Class NoOpScheduler (4.4.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 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
Name Description
delay TimeSpan

The theoretical delay, ignored by this implementation.

cancellationToken CancellationToken

A cancellation token which is checked in the returned task.

Returns
Type Description
Task

A task that will complete immediately after yielding.