Skip to main content
This topic provides an example of how to run a simple user task. Simple tasks can be started with the XAsyncRun function. This function takes the async block as an input and then requires implementing the work callback as a functor or lambda input. Remember that the async block specifies the task queue to use and the optional completion callback.
This example uses XAsyncRunto start a custom, simple asynchronous task. The async block contains the task queue to use and the completion callback. XAsyncRun requires a work callback, and it has a return value. It’s returned from a call to XAsyncGetStatus afterward. Internally, XAsyncRun has a simple async provider setup to handle the enqueuing of the specified work callback, the enqueuing of the completion callback in the async block, and other state changes for the process. This means that no further code is needed for running simple async tasks - just set up the async block and call XAsyncRun.

Reference API documentation

See also

XAsync library overview Set up async task (example) Run Microsoft Game Development Kit (GDK) API task (example) XAsync
Last modified on August 4, 2026