Open sandboxFocus

Method InitializeAsync

InitializeAsync(CancellationToken)

Initializes the garbage collector asynchronously. This method must be called before the garbage collector can process eviction notifications or perform cleanup operations.

Declaration
public Task InitializeAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

A CancellationToken.

Returns
Type Description
Task

A Task representing the asynchronous operation.

Exceptions
Type Condition
InvalidOperationException

The garbage collector does not own its backend and the backend has not been initialized.