From 35bf76ea71e153fab140af166ec07b3a961af3f0 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 4 Nov 2024 13:02:28 -0500 Subject: Requests are no longer saved --- database.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 database.h (limited to 'database.h') diff --git a/database.h b/database.h deleted file mode 100644 index d8d9b67..0000000 --- a/database.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef DATABASE_H_0A27B356 -#define DATABASE_H_0A27B356 - -#include -#include -#include -#include -#include -#include -#include - -class database { - public: - // Feel free to throw an exception if the subscriber should be killed. - using subscribe_callback_type = std::function; - - std::string create(std::mt19937& rng); - - void subscribe(const std::string& token, subscribe_callback_type callback); - void post(const std::string& token, const std::string& msg); - - void setResult(const std::string& token, const std::string& result); - const std::string& getResult(const std::string& token); - - void mark_done(const std::string& token); - bool is_done(const std::string& token); - - private: - struct request { - std::vector> subscribers; - std::string result; - bool done = false; - }; - - std::mutex mutex_; - - std::map requests_; -}; - -#endif /* end of include guard: DATABASE_H_0A27B356 */ -- cgit 1.4.1