zookeeper-cpp
ZooKeeper Client for C++
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups
server.hpp
1 #pragma once
2 
3 #include <zk/config.hpp>
4 
5 #include <memory>
6 #include <string>
7 #include <thread>
8 
9 namespace zk::server
10 {
11 
17 class package_registry;
18 
20 class server final
21 {
22 public:
26  explicit server(std::string classpath);
27 
28  ~server() noexcept;
29 
36  static std::shared_ptr<server> create(package_registry& registry);
37 
38  void shutdown(bool wait_for_stop = false);
39 
40 private:
41  void run_process(std::string classpath);
42 
43 private:
44  bool _running;
45  std::thread _worker;
46 };
47 
50 }
static std::shared_ptr< server > create(package_registry &registry)
Create a running server process with the best (newest) version from the provided registry.
Controls a ZooKeeper server process on this local machine.
Definition: server.hpp:20
server(std::string classpath)
The package registry tracks configuration of classpaths and JARs needed to run various ZooKeeper vers...