add http_client library, using libcurl

take out common http entities to http_common dir
This commit is contained in:
2024-11-23 17:54:22 +03:00
parent bf9ad65ff0
commit dff4f2b3a0
17 changed files with 955 additions and 137 deletions

View File

@@ -0,0 +1,32 @@
#ifndef curl_thread_pool_p_H
#define curl_thread_pool_p_H
#include "piconditionvar.h"
#include "piprotectedvariable.h"
#include "pisemaphore.h"
#include "pithread.h"
class PIHTTPClient;
class CurlThreadPool {
public:
void registerClient(PIHTTPClient * c);
static CurlThreadPool * instance();
private:
NO_COPY_CLASS(CurlThreadPool)
CurlThreadPool();
~CurlThreadPool();
void threadFunc();
void procClient(PIHTTPClient * c);
PIProtectedVariable<PIQueue<PIHTTPClient *>> clients;
PISemaphore sem;
PIVector<PIThread *> threads;
std::atomic_bool exiting = {false};
};
#endif