4.5 Performing Asynchronous Tasks

The Virtual Disk Service Remote Protocol exposes certain potentially long-running configuration tasks. Such tasks can be performed asynchronously. The following figure shows an example of an asynchronous task, formatting a volume.

Asynchronous task of formatting a volume

Figure 9: Asynchronous task of formatting a volume

  1. The client requests that a volume be formatted by calling the IVdsVolumeMF::Format method.

  2. The server acknowledges the format request and returns an IVdsAsync interface that the client can use to monitor progress of the format operation.

  3. The client checks the current status of the format operation by calling the IVdsAsync::QueryStatus method on the returned IVdsAsync interface.

  4. The server returns the status of the format operation.

  5. The client can repeatedly check the status of the format operation by calling the IVdsAsync::QueryStatus method.

  6. For each IVdsAsync::QueryStatus request, the server returns the latest status of the format operation.

  7. The client can wait for the format operation to complete by calling the IVdsAsync::Wait method.

  8. When the format operation completes, the server responds to the IVdsAsync::Wait call by returning the final status of the format.

  9. The client invokes the IVdsAsync::Release method to release its reference.

  10. The server returns the new reference count for the IVdsAsync interface.