Table of Contents

Class AsyncDisposeCallback

Namespace
Prefrontal.Common
Assembly
Prefrontal.Core.dll

Represents an asynchronous disposable object that invokes a callback when disposed.

public sealed record AsyncDisposeCallback : IAsyncDisposable, IEquatable<AsyncDisposeCallback>
Inheritance
AsyncDisposeCallback
Implements
Inherited Members
Extension Methods

Constructors

AsyncDisposeCallback(Func<ValueTask>)

Represents an asynchronous disposable object that invokes a callback when disposed.

public AsyncDisposeCallback(Func<ValueTask> OnDisposeAsync)

Parameters

OnDisposeAsync Func<ValueTask>

The callback to invoke when the object is disposed.

Properties

OnDisposeAsync

The callback to invoke when the object is disposed.

public Func<ValueTask> OnDisposeAsync { get; init; }

Property Value

Func<ValueTask>

Methods

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.