Partager via


XAsyncSchedule

Schedules work for the callback function of an asynchronous provider.

Syntax

HRESULT XAsyncSchedule(  
         XAsyncBlock* asyncBlock,  
         uint32_t delayInMs  
)  

Parameters

asyncBlock   _Inout_
Type: XAsyncBlock*

A pointer to the XAsyncBlock that was passed to XAsyncBegin for the asynchronous call.

delayInMs   _In_
Type: uint32_t

How long the system should wait, in milliseconds, before scheduling the asynchronous call with the asynchronous queue.

Return value

Type: HRESULT

Returns S_OK if successful; otherwise, returns an error code. For a list of error codes, see Error Codes.

Remarks

This function is optional, and provides more control over scheduling asynchronous work for an asynchronous provider. If the asynchronous work can be done through a system-managed asynchronous mechanism, such as overlapped I/O, you don't need to call this function.

If asynchronous work should be scheduled after a delay, specify in delayInMs the number of milliseconds that XAsyncSchedule should wait before it schedules asynchronous work.

For an example of an asynchronous provider that uses XAsyncSchedule to schedule asynchronous work, see the "Async Library" section in Asynchronous Programming Model.

Requirements

Header: XAsyncProvider.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

XAsyncProvider Members
XAsyncBegin
XAsyncSchedule
Asynchronous Programming Model