9#include <userver/compiler/select.hpp>
10#include <userver/engine/deadline.hpp>
11#include <userver/engine/subprocess/child_process_status.hpp>
12#include <userver/utils/fast_pimpl.hpp>
14USERVER_NAMESPACE_BEGIN
16namespace engine::subprocess {
18class ChildProcessImpl;
20class ChildProcess
final {
23 explicit ChildProcess(ChildProcessImpl&& impl)
noexcept;
26 ChildProcess(ChildProcess&&)
noexcept;
27 ChildProcess& operator=(ChildProcess&&)
noexcept;
41 template <
typename Rep,
typename Period>
42 [[nodiscard]]
bool WaitFor(std::chrono::duration<Rep, Period> duration) {
43 return WaitUntil(Deadline::FromDuration(duration));
49 template <
typename Clock,
typename Duration>
50 [[nodiscard]]
bool WaitUntil(std::chrono::time_point<Clock, Duration> until) {
51 return WaitUntil(Deadline::FromTimePoint(until));
67 static constexpr std::size_t kImplSize = compiler::SelectSize().For64Bit(24).For32Bit(12);
68 static constexpr std::size_t kImplAlignment =
alignof(
void*);
69 utils::FastPimpl<ChildProcessImpl, kImplSize, kImplAlignment> impl_;