New subscription manager (#1071)

Fix #886
This commit is contained in:
cyan317
2024-01-08 14:45:57 +00:00
committed by GitHub
parent 07bd4b0760
commit eb1831c489
37 changed files with 4427 additions and 2098 deletions

View File

@@ -37,10 +37,6 @@ concept SomeServerHandler =
{
handler(req, ws)
};
// the callback when there is an error
{
handler(ec, ws)
};
};
} // namespace web

View File

@@ -22,6 +22,7 @@
#include "util/Taggable.h"
#include <boost/beast/http.hpp>
#include <boost/signals2.hpp>
#include <utility>
@@ -42,6 +43,8 @@ public:
std::string const clientIp;
bool upgraded = false;
bool isAdmin_ = false;
boost::signals2::signal<void(ConnectionBase*)> onDisconnect;
std::uint32_t apiSubVersion = 0;
/**
* @brief Create a new connection base.
@@ -54,7 +57,10 @@ public:
{
}
~ConnectionBase() override = default;
~ConnectionBase() override
{
onDisconnect(this);
};
/**
* @brief Send the response to the client.