1 #include "connection.hpp" 2 #include "connection_zk.hpp" 6 #include <zookeeper/zookeeper.h> 11 connection::~connection() noexcept
14 std::shared_ptr<connection> connection::connect(string_view conn_string)
16 return std::make_shared<connection_zk>(conn_string);
21 std::unique_lock<std::mutex> ax(_state_change_promises_protect);
22 _state_change_promises.emplace_back();
23 return _state_change_promises.rbegin()->get_future();
28 std::unique_lock<std::mutex> ax(_state_change_promises_protect);
29 auto l_state_change_promises = std::move(_state_change_promises);
34 : std::exception_ptr();
36 for (
auto& p : l_state_change_promises)
41 p.set_value(new_state);
state
Enumeration of states the client may be at when a watch triggers.
Authentication has failed – connection requires a new connection instance with different credentials...
virtual future< zk::state > watch_state()
Watch for a state change.
The serving cluster has expired this session.
virtual void on_session_event(zk::state new_state)
Call this from derived classes when a session event happens.