-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathrequest_module.hpp
More file actions
45 lines (36 loc) · 1.27 KB
/
request_module.hpp
File metadata and controls
45 lines (36 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef REQUEST_MODULE_HPP_
#define REQUEST_MODULE_HPP_
#include <map>
#include <memory>
#include <mutex>
#include <string>
#include "countly/countly_configuration.hpp"
#include "countly/logger_module.hpp"
#include "countly/request_builder.hpp"
#include "countly/storage_module_base.hpp"
namespace cly {
class RequestModule {
public:
~RequestModule();
RequestModule(std::shared_ptr<CountlyConfiguration> config, std::shared_ptr<LoggerModule> logger, std::shared_ptr<RequestBuilder> requestBuilder, std::shared_ptr<StorageModuleBase> storageModule);
HTTPResponse sendHTTP(std::string path, std::string data);
/**
* SDK central execution call for processing requests in the request queue.
* Only one sender is active at a time. Requests are processed in order.
*/
void processQueue(std::shared_ptr<std::mutex> mutex);
void addRequestToQueue(const std::map<std::string, std::string> &data);
/**
* Clear request queue.
* Warning: This method is for debugging purposes, and it is going to be removed in the future.
* You should not be using this method.
* @return a vector object containing requests.
*/
void clearRequestQueue();
long long RQSize();
private:
class RequestModuleImpl;
std::unique_ptr<RequestModuleImpl> impl;
};
} // namespace cly
#endif