feat(SystemAsync): add async IO ProcessManager/communicate and shared WatcherService with WatchSubscription (M-SYSTEM-03, M-SYSTEM-04)

This commit is contained in:
faumaray committed 2026-11-24 14:46:46 +03:00
1 parent fcdbc063b2
commit 9a3c5d86ef
9 files changed
+2062

No files matched your search

+10
View File
@@ -126,6 +126,16 @@ if(_has_system)
-DCMAKE_DISABLE_FIND_PACKAGE_SQLite3=TRUE)
endif()
has_modules(_has_system_async SystemAsync System Async IO Time Functional LogState)
if(_has_system_async)
run_consumer(SystemAsyncOnly "${install_prefix}" "SystemAsyncOnly"
-DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_LibArchive=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_SQLite3=TRUE)
endif()
has_modules(_has_obs_hooks ObservabilityHooks)
if(_has_obs_hooks)
run_consumer(ObservabilityHooksOnly "${install_prefix}" "ObservabilityHooksOnly" ${_no_external_deps})
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 4.0)
project(VoidSystemAsyncOnlyConsumer LANGUAGES CXX)
find_package(Void CONFIG REQUIRED COMPONENTS SystemAsync)
add_executable(void_system_async_only_consumer main.cpp)
target_link_libraries(void_system_async_only_consumer PRIVATE Void::SystemAsync)
target_compile_features(void_system_async_only_consumer PRIVATE cxx_std_26)
enable_testing()
add_test(NAME SystemAsyncOnlyConsumer COMMAND void_system_async_only_consumer)
+21
View File
@@ -0,0 +1,21 @@
#include <Void/Async/Executor.hpp>
#include <Void/IO/Driver.hpp>
#include <Void/System/AsyncProcess.hpp>
#include <Void/System/AsyncWatcher.hpp>
int main()
{
Void::Async::ManualExecutor exec;
auto drv = Void::IO::Driver::create(exec);
if (!drv.has_value()) {
return 1;
}
Void::SystemAsync::ProcessManager mgr{**drv, exec};
Void::SystemAsync::WatcherService watcher{exec};
if (mgr.active_children() != 0 || watcher.watch_count() != 0) {
return 2;
}
(void)watcher.shutdown();
(void)(*drv)->shutdown_and_join();
return 0;
}