64 auto promise = std::make_shared<std::promise<T>>();
69 promise->set_value(func());
73 promise->set_exception(std::current_exception());
76 return promise->get_future();
81 auto promise = std::make_shared<std::promise<void>>();
91 promise->set_exception(std::current_exception());
94 return promise->get_future();
Main thread message pump processing.
Definition run_loop.h:38
static std::future< T > main_thread_task(std::function< T()> func)
Executes a task on the main thread with a future result.
Definition run_loop.h:62
static void main_thread_async(std::function< void()> func)
Executes a function on the main thread during message processing.
static std::future< void > main_thread_task(std::function< void()> func)
Definition run_loop.h:79
static bool process(int timeout_ms=0)
Process messages for specified amount of time.
static void run()
Continously process messages until RunLoop::exit() is called.
static void exit()
Signal that message processing should end immediately.