Show / Hide Table of Contents

Class SystemScheduler

Singleton implementation of IScheduler which uses System.Threading.Tasks.Task.Delay(System.TimeSpan,System.Threading.CancellationToken).

Inheritance
System.Object
SystemScheduler
Implements
IScheduler
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Api.Gax
Assembly: Google.Api.Gax.dll
Syntax
public sealed class SystemScheduler : IScheduler

Properties

Instance

Retrieves the singleton instance.

Declaration
public static SystemScheduler Instance { get; }
Property Value
Type Description
SystemScheduler

Methods

Delay(TimeSpan, 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.)

Declaration
public Task Delay(TimeSpan timeSpan, CancellationToken cancellationToken)
Parameters
Type Name Description
System.TimeSpan timeSpan
System.Threading.CancellationToken cancellationToken

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

Returns
Type Description
System.Threading.Tasks.Task

A task which will complete after the given delay.

Implements
IScheduler.Delay(TimeSpan, CancellationToken)

Extension Methods

SchedulerExtensions.Sleep(IScheduler, TimeSpan, CancellationToken)
Back to top