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

+5
View File
@@ -111,6 +111,11 @@ if(_has_io)
run_consumer(IOOnly "${install_prefix}" "IOOnly" ${_no_external_deps})
endif()
has_modules(_has_runtime Runtime IO Async Algorithms Memory Time Functional Core)
if(_has_runtime)
run_consumer(RuntimeOnly "${install_prefix}" "RuntimeOnly" ${_no_external_deps})
endif()
# Foundation consumer with Core-formatting bridge and zero external packages.
has_modules(_has_foundation Math Text Time Functional Binary FunctionalCoreFormatting Memory Core)
if(_has_foundation)
+10
View File
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 4.0)
project(VoidRuntimeOnlyConsumer LANGUAGES CXX)
find_package(Void CONFIG REQUIRED COMPONENTS Runtime)
add_executable(void_runtime_only_consumer main.cpp)
target_link_libraries(void_runtime_only_consumer PRIVATE Void::Runtime)
enable_testing()
add_test(NAME VoidRuntimeOnlyConsumer COMMAND void_runtime_only_consumer)
+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;
}