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.


Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.2.0
public interface IAsyncContext


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.


See Also