Split server in smaller modules

This commit is contained in:
Yves
2025-02-21 12:46:41 +01:00
parent ae104f697a
commit f1cc3c667d
10 changed files with 339 additions and 245 deletions

28
src/include/watcher.hpp Normal file
View 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