Submitting Requests Asynchronously
To submit requests to the Service asynchronously, use the submit functions. They follow the same format as execute. One of the two functions is more suitable depending on the number of input arguments the Service function takes: submit for zero or one argument, and submitWithArray for more than one argument.
The submit functions return immediately, with the invocation ID (a Long integer) as the output argument. The ID increments sequentially and starts at 0; it can be used to identify results when they are later collected.
Dim ID1 As Long
ID1 = service.submit ("getMemory ", "", Nothing)
Dim ID2 As Long
Dim args(1) As String
args(0) = "25"
args(1) = "75"
ID2 = service.submitWithArray("add", args, Nothing)
The results are collected by calling the collectNext function.