Table of Contents

Interface IGetPooledManualResetValueTaskSource<T>

Namespace
CryptoHives.Foundation.Threading.Pools
Assembly
CryptoHives.Foundation.Threading.dll

Defines a contract for providing pooled, reusable manual-reset value task sources for asynchronous operations of type T.

public interface IGetPooledManualResetValueTaskSource<T>

Type Parameters

T

Methods

GetPooledWaiter(object)

Retrieves a pooled instance of a manual reset value task source associated with the specified owner.

PooledManualResetValueTaskSource<T> GetPooledWaiter(object owner)

Parameters

owner object

The object that will be associated with the returned pooled waiter. Cannot be null.

Returns

PooledManualResetValueTaskSource<T>

A pooled manual reset value task source of type T that is associated with the specified owner.

Remarks

In addition to the base Get() behavior, this method sets the owner pool and the owner of the retrieved instance. The returned instance is obtained from a pool and may be reused. The value is implicitly returned to the owner pool when the operation is complete and the result has been retrieved. The owner is needed for efficient implementation of cancellation token registration callbacks. The CancellationToken property of the returned instance is not initialized. The CancellationTokenRegistration property of the returned instance is initially set to default. The UseContinuationAsynchronously property of the returned instance is unspecified.