Dusk Audio Framework
Loading...
Searching...
No Matches
Runner Class Referenceabstract

#include <Runner.hpp>

Public Member Functions

bool isRunnerActive () noexcept
bool startRunner (const uint timeIntervalMilliseconds=0) noexcept
bool stopRunner () noexcept
void signalRunnerShouldStop () noexcept
const String & getRunnerName () const noexcept

Protected Member Functions

 Runner (const char *const runnerName=nullptr) noexcept
virtual bool run ()=0
bool shouldRunnerStop () const noexcept

Detailed Description

Runner class for DAF.

This is a handy class that handles "idle" time in either background or main thread, whichever is more suitable to the target platform. Typically background threads on desktop platforms, main thread on web.

A single function is expected to be implemented by subclasses, which directly allows it to stop the runner by returning false.

You can use it for quick operations that do not need to be handled in the main thread if possible. The target is to spread out execution over many runs, instead of spending a lot of time on a single task.


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