OutOfProcessNodeInstance.InvokeExportAsync Method

Definition

Overloads

InvokeExportAsync<T>(NodeInvocationInfo, CancellationToken)

Asynchronously invokes code in the Node.js instance.

InvokeExportAsync<T>(CancellationToken, String, String, Object[])

Asynchronously invokes code in the Node.js instance.

InvokeExportAsync<T>(NodeInvocationInfo, CancellationToken)

Source:
OutOfProcessNodeInstance.cs
Source:
OutOfProcessNodeInstance.cs
Source:
OutOfProcessNodeInstance.cs
Source:
OutOfProcessNodeInstance.cs

Asynchronously invokes code in the Node.js instance.

C#
protected abstract System.Threading.Tasks.Task<T> InvokeExportAsync<T> (Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationInfo invocationInfo, System.Threading.CancellationToken cancellationToken);

Type Parameters

T

The JSON-serializable data type that the Node.js code will asynchronously return.

Parameters

invocationInfo
NodeInvocationInfo

Specifies the Node.js function to be invoked and arguments to be passed to it.

cancellationToken
CancellationToken

A CancellationToken that can be used to cancel the invocation.

Returns

Task<T>

A Task<TResult> representing the completion of the RPC call.

Applies to

ASP.NET Core 3.1 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1

InvokeExportAsync<T>(CancellationToken, String, String, Object[])

Source:
OutOfProcessNodeInstance.cs
Source:
OutOfProcessNodeInstance.cs
Source:
OutOfProcessNodeInstance.cs
Source:
OutOfProcessNodeInstance.cs

Asynchronously invokes code in the Node.js instance.

C#
public System.Threading.Tasks.Task<T> InvokeExportAsync<T> (System.Threading.CancellationToken cancellationToken, string moduleName, string exportNameOrNull, params object[] args);

Type Parameters

T

The JSON-serializable data type that the Node.js code will asynchronously return.

Parameters

cancellationToken
CancellationToken

A CancellationToken that can be used to cancel the invocation.

moduleName
String

The path to the Node.js module (i.e., JavaScript file) relative to your project root that contains the code to be invoked.

exportNameOrNull
String

If set, specifies the CommonJS export to be invoked. If not set, the module's default CommonJS export itself must be a function to be invoked.

args
Object[]

Any sequence of JSON-serializable arguments to be passed to the Node.js function.

Returns

Task<T>

A Task<TResult> representing the completion of the RPC call.

Implements

Applies to

ASP.NET Core 3.1 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1