feat(Runtime): add inert Host, validated RuntimeLimits, EmbeddedResources, and topological ResourceGraph (S-RUNTIME-01)

This commit is contained in:
faumaray committed 2026-11-24 09:33:03 +03:00
1 parent 673bb7e8b4
commit 1b3331e3a8
9 files changed
+812 -1

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
#include <Void/Async/Executor.hpp>
#include <Void/IO/Driver.hpp>
#include <Void/Runtime/Host.hpp>
#include <Void/Time/Clock.hpp>
int main()
{
auto host = Void::Runtime::Host::create();
if (!host.has_value() ||
host->state() != Void::Runtime::HostState::constructed ||
host->started_worker_count() != 0) {
return 1;
}
Void::Async::ManualExecutor exec;
Void::Time::ManualClock clock;
auto drv = Void::IO::Driver::create(
exec, Void::IO::BackendOptions{.preference = Void::IO::BackendPreference::mock}, clock);
if (!drv.has_value()) {
return 1;
}
auto emb = Void::Runtime::Host::create_embedded(
Void::Runtime::Options{},
Void::Runtime::EmbeddedResources{
.executor = &exec,
.io = drv->get(),
.clock = &clock,
});
return (emb.has_value() && emb->options().embedded_mode) ? 0 : 1;
}