ComponentCallContext Class

A call of a function of the host by a component.

public sealed class ComponentCallContext

Properties

NameDescription
CancellationTokenGets the token that is cancelled when the component cancels an asynchronous call.
StoreGets the store of the component.
TypeGets the type of the function, as the component imports it.

CancellationToken

WasmComponent.cs

Gets the token that is cancelled when the component cancels an asynchronous call.

public CancellationToken CancellationToken { get; init; }

Property value

CancellationToken

Gets the store of the component.

public WasmStore Store { get; }

Property value

WasmStore

Gets the type of the function, as the component imports it.

public ComponentFunctionType Type { get; }

Property value

ComponentFunctionType

Methods

NameDescription
RunInBackground(Func<Task>)Runs an operation of the host that continues after the call returns, such as a copy between a stream of a component and a .NET stream: the store waits for it when the components wait, and its continuations run on the thread of the store.

RunInBackground(Func<Task>)

WasmComponent.cs

Runs an operation of the host that continues after the call returns, such as a copy between a stream of a component and a .NET stream: the store waits for it when the components wait, and its continuations run on the thread of the store.

public void RunInBackground(Func<Task> operation)

Parameters

operation Func<Task>
The operation.