1#pragma once
2
3#include <common/Types.h>
4#include <future>
5#include <memory>
6#include <vector>
7#include <Common/ZooKeeper/IKeeper.h>
8#include <Poco/Event.h>
9
10
11namespace zkutil
12{
13
14using Strings = std::vector<std::string>;
15
16
17namespace CreateMode
18{
19 extern const int Persistent;
20 extern const int Ephemeral;
21 extern const int EphemeralSequential;
22 extern const int PersistentSequential;
23}
24
25using EventPtr = std::shared_ptr<Poco::Event>;
26
27/// Gets multiple asynchronous results
28/// Each pair, the first is path, the second is response eg. CreateResponse, RemoveResponse
29template <typename R>
30using AsyncResponses = std::vector<std::pair<std::string, std::future<R>>>;
31
32Coordination::RequestPtr makeCreateRequest(const std::string & path, const std::string & data, int create_mode);
33Coordination::RequestPtr makeRemoveRequest(const std::string & path, int version);
34Coordination::RequestPtr makeSetRequest(const std::string & path, const std::string & data, int version);
35Coordination::RequestPtr makeCheckRequest(const std::string & path, int version);
36
37}
38