This method creates the moniker and calls the method without waiting for completion.
If the target is specified by a moniker, the created instance is released after the method call completes.
function asyncInvokeListener()
{
this.onAsyncInvokeComplete = onAsyncInvokeCompleteFunc;
}
function onAsyncInvokeCompleteFunc(result, outVal)
{
//code to use the result and return value of the method call
}
//main program
function main()
{
var messageObj = shell.serviceManager.basics.message;
var timerObj = shell.serviceManager.basics.timer;
var messageListener = new asyncInvokeListener();
messageObj.fromURI("ee://aol/basics/bigInt?method=compare&a0=100");
//this should return result = 0; outVal = -1
messageObj.asyncInvoke(messageListener, 5000);
//calling asyncInvoke with an object
var bigInt = shell.serviceManager.basics.bigInt;
var argList = shell.serviceManager.basics.array;
argList.addValue(-100);
messageObj.target = bigInt;
messageObj.method = "compare";
messageObj.arguments = argList;
//this should return result = 0; outVal = 1
messageObj.asyncInvoke(messageListener, 5000);
//user must provide message pumping code here in order to make sure
//program doesn't exits before the listener gets called
}