4.4 Asynchronous Delivery of Results

An asynchronous method returns before the requested operation completes. The server continues to execute the request and delivers the results to the client using a response handler when the results are available. The response handler receives the results as they become available. The IWbemObjectSink::Indicate method is called by the server when a result is found during the operation.

To make an asynchronous query, the client uses the IWbemServices interface pointer and it passes the IWbemObjectSink interface when calling an asynchronous method of the IWbemServices interface.

If the asynchronous call returns SUCCESS, the server keeps a reference to the IWbemObjectSink interface pointer. If the server is required to return WMI objects to the client, the server delivers the results through the IWbemObjectSink::Indicate method.

After the delivery of all objects, the server makes a single call to IWbemObjectSink::SetStatus to indicate that the operation finished, specifying the final status of the operation. After that, the server releases the IWbemObjectSink pointer.

Asynchronous delivery of results

Figure 18: Asynchronous delivery of results