Add scheduler, add support for GSC method adding, command adding.

Some cleanup. Add exception handler.
This commit is contained in:
JezuzLizard
2023-03-24 15:04:25 -07:00
parent 34b90247c9
commit 74f6a66374
19 changed files with 886 additions and 102 deletions

View File

@ -0,0 +1,23 @@
#pragma once
namespace scheduler
{
enum pipeline
{
server,
async,
count,
};
static const bool cond_continue = false;
static const bool cond_end = true;
void schedule(const std::function<bool()>& callback, pipeline type = pipeline::server,
std::chrono::milliseconds delay = 0ms);
void loop(const std::function<void()>& callback, pipeline type = pipeline::server,
std::chrono::milliseconds delay = 0ms);
void once(const std::function<void()>& callback, pipeline type = pipeline::server,
std::chrono::milliseconds delay = 0ms);
void on_init(const std::function<void()>& callback);
}