Stormancer::MainThreadActionDispatcher Class Reference

Inherits Stormancer::IActionDispatcher.

Public Member Functions

virtual void post (const std::function< void(void)> &action) override
 
virtual void start (const DependencyScope &scope) override
 
virtual pplx::task< void > stop () override
 
virtual bool isRunning () override
 
void update (const std::chrono::milliseconds maxDuration)
 Run the actions in the current thread. More...
 

Member Function Documentation

◆ update()

void Stormancer::MainThreadActionDispatcher::update ( const std::chrono::milliseconds  maxDuration)

Run the actions in the current thread.

Parameters
maxDurationMax duration the update method should run (it can take more time, but as soon as maxDuration is exceeded, update will return as soon as the current executing action returns.)

Note that maxDuration is the real time spent in the function, not the CPU time. So, in scenarios where there is a high contention for CPU resources, it is not representative of the actual cost of the function. You should make sure to set it high enough so that every pending action can run ; otherwise, pending actions will accumulate inside the dispatcher, increasingly delaying the processing of events by the game.


The documentation for this class was generated from the following file: