♻️ Major clean up of project structure

This commit is contained in:
Rune Harlyk
2025-09-11 17:14:31 +02:00
committed by Rune Harlyk
parent 26c36b8302
commit 7fd35f3f48
25 changed files with 370 additions and 890 deletions
+4 -4
View File
@@ -14,9 +14,9 @@ typedef std::function<void(const String &originId, bool sync)> SubscribeCallback
class EventSocket {
public:
EventSocket();
EventSocket(PsychicHttpServer &server, const char *route = "/api/ws");
PsychicWebSocketHandler *getHandler() { return &_socket; }
void begin();
bool hasSubscribers(const char *event);
@@ -28,6 +28,8 @@ class EventSocket {
private:
PsychicWebSocketHandler _socket;
PsychicHttpServer &_server;
const char *_route;
std::map<String, std::list<int>> client_subscriptions;
std::map<String, std::list<EventCallback>> event_callbacks;
@@ -41,6 +43,4 @@ class EventSocket {
esp_err_t onFrame(PsychicWebSocketRequest *request, httpd_ws_frame *frame);
};
extern EventSocket socket;
#endif