|
MantisBase v0.3.4
|
#include <sse.h>
Public Member Functions | |
| SSEMgr ()=default | |
| ~SSEMgr () | |
| std::string | createSession (const std::set< std::string > &initial_topics) |
| std::shared_ptr< SSESession > | fetchSession (const std::string &session_id) |
| void | removeSession (const std::string &session_id) |
| void | updateActivity (const std::string &session_id) |
| std::shared_ptr< mb::SSESession > | getSession (const std::string &sessionId) |
| void | broadcastChange (const json &change_event) |
| size_t | getSessionCount () |
| void | start () |
| void | stop () |
| bool | isRunning () const |
Static Public Member Functions | |
| static void | createRoutes () |
| static std::function< void(MantisRequest &, MantisResponse &)> | handleSSESession () |
| static std::function< void(MantisRequest &, MantisResponse &)> | handleSSESessionUpdate () |
Manages SSE sessions, routes realtime change events, and registers GET/POST /api/v1/realtime.
|
default |
| mb::SSEMgr::~SSEMgr | ( | ) |
| void mb::SSEMgr::broadcastChange | ( | const json & | change_event | ) |
Push a change event to all sessions interested in its topic.
|
static |
Register GET and POST /api/v1/realtime routes.
| std::string mb::SSEMgr::createSession | ( | const std::set< std::string > & | initial_topics | ) |
Create a new SSE session with the given topics and optional auth details; returns client_id (session id).
| std::shared_ptr< mb::SSESession > mb::SSEMgr::fetchSession | ( | const std::string & | session_id | ) |
| std::shared_ptr< mb::SSESession > mb::SSEMgr::getSession | ( | const std::string & | sessionId | ) |
| size_t mb::SSEMgr::getSessionCount | ( | ) |
|
static |
|
static |
| bool mb::SSEMgr::isRunning | ( | ) | const |
| void mb::SSEMgr::removeSession | ( | const std::string & | session_id | ) |
Remove session and close it (disconnect).
| void mb::SSEMgr::start | ( | ) |
| void mb::SSEMgr::stop | ( | ) |
| void mb::SSEMgr::updateActivity | ( | const std::string & | session_id | ) |