21 lines
558 B
C++
21 lines
558 B
C++
#include <Void/Async/Executor.hpp>
|
|
#include <Void/Configuration/ReloadController.hpp>
|
|
|
|
#include <string>
|
|
|
|
struct AsyncCfg {
|
|
std::string mode{"ok"};
|
|
};
|
|
|
|
int main()
|
|
{
|
|
Void::Async::ManualExecutor exec;
|
|
Void::Configuration::SourceSet ss;
|
|
ss.add_defaults_map("d", {{"mode", "fast"}});
|
|
auto schema = Void::Configuration::Schema<AsyncCfg>::from_reflection();
|
|
auto ctrl = Void::Configuration::ReloadController<AsyncCfg>::create(
|
|
schema, std::move(ss), {.executor = &exec});
|
|
if (!ctrl) return 1;
|
|
return (*ctrl)->current().values->mode == "fast" ? 0 : 2;
|
|
}
|