dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Model

AbortManager Class

The AbortManager translates a .NET System.Threading.CancellationToken into a JavaScript abort signal.

public class AbortManager :
System.IAsyncDisposable

Inheritance System.Object 🡒 AbortManager

Implements System.IAsyncDisposable

Constructors

AbortManager(IJSObjectReference) Constructor

Creates a new AbortManager.

public AbortManager(Microsoft.JSInterop.IJSObjectReference jsModule);

Parameters

jsModule Microsoft.JSInterop.IJSObjectReference

The CoreJsModule to use for JavaScript interop.

AbortManager(IJSRuntime, JsModuleManager) Constructor

Creates a new AbortManager.

public AbortManager(Microsoft.JSInterop.IJSRuntime jsRuntime, dymaptic.GeoBlazor.Core.JsModuleManager jsModuleManager);

Parameters

jsRuntime Microsoft.JSInterop.IJSRuntime

The Microsoft.JSInterop.IJSRuntime to use for JavaScript interop.

jsModuleManager JsModuleManager

The JsModuleManager to use for JavaScript interop.

Methods

AbortManager.CreateAbortSignal(CancellationToken) Method

Creates a new abort signal for the given System.Threading.CancellationToken.

public System.Threading.Tasks.Task<Microsoft.JSInterop.IJSObjectReference> CreateAbortSignal(System.Threading.CancellationToken cancellationToken);

Parameters

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to create the abort signal for.

Returns

System.Threading.Tasks.Task<Microsoft.JSInterop.IJSObjectReference>

Remarks

Uses of this method should always be followed by DisposeAbortController(CancellationToken) when you are finished with the JavaScript calls.

AbortManager.DisposeAbortController(CancellationToken) Method

Disposes the signal created for a specific JavaScript call, this should always be called when you are done with the signal.

public System.Threading.Tasks.Task DisposeAbortController(System.Threading.CancellationToken cancellationToken);

Parameters

cancellationToken System.Threading.CancellationToken

The System.Threading.CancellationToken to abort the query for.

Returns

System.Threading.Tasks.Task

AbortManager.DisposeAsync() Method

Disposes the full AbortManager, and cancels all queries.

public System.Threading.Tasks.ValueTask DisposeAsync();

Implements DisposeAsync()

Returns

System.Threading.Tasks.ValueTask