Show / Hide Table of Contents

Struct TaskSchedulerScope

Represents the scope of the asynchronous method executed by the task scheduler.

Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: DotNext.Threading.Tasks
Assembly: DotNext.Threading.dll
Syntax
public readonly struct TaskSchedulerScope
Remarks

This type intentionally doesn't implement IAsyncDisposable, because the continuation of ValueTask returned by DisposeAsync() is executed by the scheduler that is being left. The scope must be used with await using statement only.

Methods

View Source

DisposeAsync()

Switches the asynchronous method back to the original synchronization context or scheduler.

Declaration
public SchedulingContextAwaitable DisposeAsync()
Returns
Type Description
SchedulingContextAwaitable

The awaitable object that resumes the caller on the original synchronization context or scheduler.

Extension Methods

BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾