Skip to main content
This topic provides an example of how to set up a custom async provider. When writing a custom async provider, async methods are started by a call to XAsyncBegin. This function has a callback parameter that implements, for example, the handling of state changes, enqueueing callbacks, and triggering completion.
There’s a lot to unpack here, but the basic idea is straightforward: call XAsyncBegin, and give it a provider callback to handle the different state changes. Recall that the async block contains the task queue to use and an optional implementation of a completion callback. The callback must then handle the five different cases for the async task’s runtime as shown in the following table.

Reference API documentation

See also

XAsyncProvider library overview Set up invocation methods (example) Set up return data (example) Set up Cancelability (example) XAsyncProvider
Last modified on October 20, 2026