PartyManager::DoWork

Synchronously performs the processing task associated with threadId.

Syntax

PartyError DoWork(  
    PartyThreadId threadId  
)  

Parameters

threadId   PartyThreadId

A high-level categorization of the Party library's internal processing task.

Return value

PartyError

c_partyErrorSuccess if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via GetErrorMessage().

Remarks

This method will fail and return an error if the work mode of threadId has not previously been set to PartyWorkMode::Manual via a call to SetWorkMode(). Additionally, on the Windows, Xbox One XDK, and Microsoft Game Core versions of the library, this method will fail and return an error if the title thread calling this method does not exist in a COM multithreaded apartment when threadId is PartyThreadId::Networking.

By default, the Party library will internally manage the processing task associated with threadId. However, if the work mode of threadId is configured as PartyWorkMode::Manual via a call to SetWorkMode(), the title must periodically call this method to perform the processing task instead.

The processing task associated with threadId dictates the frequency at which this method should be called. The processing task associated with PartyThreadId::Audio should be performed every 40ms, while the processing task associated with PartyThreadId::Networking should be performed every 50 to 100ms. Internally, processing tasks will attempt to handle small variations in timing, but issues will arise if timing strays too far from what is expected (e.g. audio stutter, network state desynchronization).

For more information on processing task types and timing expectations, see PartyThreadId.

Requirements

Header: Party.h

See also

PartyManager
PartyManager::SetWorkMode
PartyManager::GetWorkMode