<PackageReference Include="Nito.Disposables" Version="2.2.1" />

Nito.Disposables.Internals.BoundAsyncActionField<T>

public sealed class BoundAsyncActionField<T>
A field containing a bound asynchronous action.
public interface IBoundAction<T>

An action delegate bound with its context.

public bool IsEmpty { get; }

Whether the field is empty.

public BoundAsyncActionField(Func<T, ValueTask> action, T context)

Initializes the field with the specified action and context.

Atomically retrieves the bound action from the field and sets the field to null. May return null.

public bool TryUpdateContext(Func<T, T> contextUpdater)

Attempts to update the context of the bound action stored in the field. Returns false if the field is null.