Click or drag to resize

MvComponentExecDuplexGlobalCallbackAsync Method

This function executes a global callback on the server and get its result in an asynchronous task.

Namespace:  RW.Server.Component
Assembly:  RW.Server.Component (in RW.Server.Component.dll) Version: 7.2.0.0 (7.2.0.0)
Syntax
public Task<MvValue> ExecDuplexGlobalCallbackAsync(
	string funNm,
	MvValue[] args
)

Parameters

funNm
Type: SystemString
Name of the callback to execute on server side.
args
Type: RW.Server.ComponentMvValue
Arguments to send to the server callback.

Return Value

Type: TaskMvValue
An asynchronous result.
Examples
MvValue[] parameters = new MvValue[2];
parameters[0] = new MvValue(42);
parameters[1] = new MvValue(51);
var tresult = _component.ExecDuplexGlobalCallbackAsync("Multiply", parameters);
Task.Run(() => {
    try {
        var result = tresult.Result;
        Console.WriteLine(" Duplex result = " + result.AsString());
    }
    catch(AggregateException e) {
        Console.WriteLine(" Duplex result canceled.");
    }
});
Examples
In an asynchronous function, you can use:
MvValue[] parameters = new MvValue[2];
parameters[0] = new MvValue(42);
parameters[1] = new MvValue(51);
try {
    MvValue result = await _component.ExecDuplexGlobalCallbackAsync("Multiply", parameters);
    Console.WriteLine(result.AsString());
}
catch(TaskCanceledException e) {
    Console.WriteLine(" Duplex result canceled.");
}
See Also