1 #include "detail/subprocess.hpp"
2 #include "package_registry.hpp"
12 server::server(std::string classpath) :
14 _worker([this, classpath = std::move(classpath)] () mutable { this->run_process(std::move(classpath)); })
17 server::~server() noexcept
25 return std::make_shared<server>(registry.find_newest_classpath().value());
28 void server::shutdown(
bool wait_for_stop)
31 if (wait_for_stop && _worker.joinable())
35 void server::run_process(std::string classpath)
37 detail::subprocess proc(
"java",
39 "-cp", std::move(classpath),
40 "org.apache.zookeeper.server.quorum.QuorumPeerMain",
48 std::cout << proc.stdout().read();
49 std::cerr << proc.stderr().read();
You can create a child node.