feat(configuration): bounded schemas, provenance/redaction, and async transactional ReloadController
This commit is contained in:
1 parent
a24e086e47
commit
1dc51d5c43
14 files changed
+3351
No files matched your search
@@ -0,0 +1,20 @@
|
||||
#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;
|
||||
}
|
||||
Reference in new issue
Block a user