Invoking the Asynchronous Method Call

The invoke method of the JadeMethodContext class submits the request for the method to be executed. The requests are handled by a JADE message queue and the method is executed by the first idle worker application.

At least one copy of the worker application should be running.

The method signature of the invoke method has a formal target parameter, which is a placeholder for the receiver object reference, the called method, and the list of parameters (if any) for the called method.

The following code fragment shows the use of the invoke method to make an asynchronous call to execute the getHistory method on an instance of the Customer class.

vars
    context : JadeMethodContext;
    cust : Customer;
    date : Date;
begin
    ...
    // The context is supplied with the necessary information
    // for the asynchronous method call and the call is initiated
    context.invoke(cust, getHistory, date);
    // The asynchronous method call is now executing in a worker application
    // or waiting in a queue to be executed
    ...

The method signature of the getHistory method in the Customer class is as follows.

Customer::getHistory(startDate: Date): String;