ReloadableApplications: supervised out-of-process provider with bounded restart policy and explicit unknown effects (P-RELOADABLE-06)

This commit is contained in:
faumaray committed 2026-12-04 10:30:15 +03:00
1 parent aad91c7d01
commit 9ba4738415
6 files changed
+611 -3

No files matched your search

@@ -0,0 +1,38 @@
#pragma once
#include "reloadable_host/supervisor.hpp"
#include <Void/System/Process.hpp>
#include <optional>
namespace ReloadableHost
{
/// Real out-of-process provider port over Void::Process.
///
/// Commands run through `/bin/sh -c` with inherited stdio (no unconsumed
/// pipes), so a noisy worker cannot fill an unread pipe and block.
class PosixWorkerPort final : public WorkerProcessPort
{
public:
PosixWorkerPort() = default;
PosixWorkerPort(const PosixWorkerPort&) = delete;
PosixWorkerPort& operator=(const PosixWorkerPort&) = delete;
~PosixWorkerPort() override;
[[nodiscard]] Void::Result::Result<void>
spawn(const std::string& command) override;
[[nodiscard]] Void::Result::Result<std::optional<WorkerExit>>
try_wait() override;
void terminate(std::chrono::milliseconds grace) noexcept override;
[[nodiscard]] bool running() const noexcept override;
private:
std::optional<Void::Process::Child> m_child{};
};
} // namespace ReloadableHost