|
CeresEngine 0.2.0
A game development framework
|
A service that allows submitting work to be ran whenever the executor is going idle. More...
#include <CeresEngine/Foundation/IO/IdleService.hpp>
Public Member Functions | |
| template<typename Function > | |
| void | post (Function &&function) |
| Submits a new callback to be invoked. | |
| void | poll () |
| Polls the service for any work. | |
Public Member Functions inherited from CeresEngine::ExecutionContext::Service< IdleService > | |
| ExecutionContext & | getExecutionContext () noexcept |
| Returns the execution context to which the service is attached to. | |
| AnyExecutor | getExecutor () noexcept |
| Returns an executor that run execute scheduled commands on the context. | |
Private Member Functions | |
| void | shutdown () final |
Private Attributes | |
| List< UniqueFunction< void()> > | mQueue |
| A list of work to be ran by the service the next time it's executor becomes idle. | |
Additional Inherited Members | |
Static Public Attributes inherited from CeresEngine::ExecutionContext::Service< IdleService > | |
| static const ID | id |
A service that allows submitting work to be ran whenever the executor is going idle.
| void CeresEngine::IdleService::poll | ( | ) |
Polls the service for any work.
Usually called from an executor the moment it goes idle.
Submits a new callback to be invoked.
| function | The function callback to be run the next time the executor goes idle. |
|
finalprivate |
|
private |
A list of work to be ran by the service the next time it's executor becomes idle.