IAsyncContext Interface

Represents the context of a possibly asynchronous operation.
See the Examples section of the AsyncHelper class to see how to create sync and async methods (supporting both Task and IAsyncResult return types) using the same shared implementation with an IAsyncContext parameter.

Definition

Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public interface IAsyncContext

Properties

CanBeCanceled Gets whether this operation can be canceled.
IsCancellationRequested Gets whether the cancellation of the current operation has been requested.
MaxDegreeOfParallelism Gets the maximum degree of parallelism. If zero or less, then it is adjusted automatically.
Progress Gets an IAsyncProgress instance that can be used to report progress, or if no progress reporter belongs to the current operation.
State Gets the user provided object that was configured in the State property this IAsyncContext instance was created from.

Methods

See Also