Table of Contents

Method DisposeAsync

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

DisposeAsync()

Cancels the read if it is still running, waits for the producer to exit, and returns the arrays to the pool.

public ValueTask DisposeAsync()

Returns

ValueTask

A task that completes when the producer has stopped and the arrays are returned.

Remarks

The wait has no timeout: it ends when the provider call in progress returns, so a provider that ignores cancellation delays it by that call. Does not throw for a well-behaved pool; for a pool whose Return throws, see the remarks of the class. Calling it again does nothing: it only observes the producer's task, so it throws again only if that task faulted. After it, Items throws ObjectDisposedException.