Megosztás a következőn keresztül:


INodeServices.InvokeAsync Method

Definition

Overloads

InvokeAsync<T>(String, Object[])

Asynchronously invokes code in the Node.js instance.

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

Asynchronously invokes code in the Node.js instance.

InvokeAsync<T>(String, Object[])

Asynchronously invokes code in the Node.js instance.

public:
generic <typename T>
 System::Threading::Tasks::Task<T> ^ InvokeAsync(System::String ^ moduleName, ... cli::array <System::Object ^> ^ args);
public System.Threading.Tasks.Task<T> InvokeAsync<T> (string moduleName, params object[] args);
abstract member InvokeAsync : string * obj[] -> System.Threading.Tasks.Task<'T>
Public Function InvokeAsync(Of T) (moduleName As String, ParamArray args As Object()) As Task(Of T)

Type Parameters

T

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

Parameters

moduleName
String

The path to the Node.js module (i.e., JavaScript file) relative to your project root whose default CommonJS export is the 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.

Applies to

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

Asynchronously invokes code in the Node.js instance.

public:
generic <typename T>
 System::Threading::Tasks::Task<T> ^ InvokeAsync(System::Threading::CancellationToken cancellationToken, System::String ^ moduleName, ... cli::array <System::Object ^> ^ args);
public System.Threading.Tasks.Task<T> InvokeAsync<T> (System.Threading.CancellationToken cancellationToken, string moduleName, params object[] args);
abstract member InvokeAsync : System.Threading.CancellationToken * string * obj[] -> System.Threading.Tasks.Task<'T>
Public Function InvokeAsync(Of T) (cancellationToken As CancellationToken, moduleName As String, ParamArray args As Object()) As Task(Of T)

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 whose default CommonJS export is the 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.

Applies to