DotNext.Threading by .NET Foundation and Contributors

<PackageReference Include="DotNext.Threading" Version="4.2.0" />

 ManualResetCompletionSource

Represents base class for producer of value task.
protected object CompletionData { get; }

Gets a value passed to the manual completion method.

public bool IsCompleted { get; }

Gets a value indicating that this source is in signaled (completed) state.

Gets the status of this source.

protected virtual void AfterConsumed()

Invokes when this source is ready to reuse.

public short Reset()

Resets the state of the source.

public bool TryReset(out short token)

Attempts to reset the state of this source.

public bool TrySetCanceled(CancellationToken token)

Attempts to complete the task unsuccessfully.

public abstract bool TrySetCanceled(object completionData, CancellationToken token)

Attempts to complete the task unsuccessfully.

public bool TrySetException(Exception e)

Attempts to complete the task unsuccessfully.

public abstract bool TrySetException(object completionData, Exception e)

Attempts to complete the task unsuccessfully.