Split server in smaller modules
This commit is contained in:
28
src/include/watcher.hpp
Normal file
28
src/include/watcher.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <duckdb.hpp>
|
||||
#include <thread>
|
||||
|
||||
namespace duckdb {
|
||||
namespace ui {
|
||||
struct CatalogState {
|
||||
std::map<idx_t, optional_idx> db_to_catalog_version;
|
||||
};
|
||||
class HttpServer;
|
||||
class Watcher {
|
||||
public:
|
||||
Watcher(HttpServer &server);
|
||||
|
||||
void Start();
|
||||
void Stop();
|
||||
|
||||
private:
|
||||
void Watch();
|
||||
unique_ptr<std::thread> thread;
|
||||
std::mutex mutex;
|
||||
std::condition_variable cv;
|
||||
std::atomic<bool> should_run;
|
||||
HttpServer &server;
|
||||
};
|
||||
} // namespace ui
|
||||
} // namespace duckdb
|
||||
Reference in New Issue
Block a user