Interface for SSE (Server-Sent Events) connections.
More...
#include <isse_connection.hpp>
|
| virtual | ~ISseConnection ()=default |
| |
| virtual void | subscribe (const std::string &request, EventCallback callback)=0 |
| | Subscribe to an SSE endpoint.
|
| |
| virtual void | close ()=0 |
| | Stop receiving events and close the SSE connection.
|
| |
Interface for SSE (Server-Sent Events) connections.
Provides streaming subscription to an SSE endpoint. Unlike IConnection::get() which returns a complete response, SSE delivers events continuously via a callback.
◆ EventCallback
◆ ~ISseConnection()
| virtual cpp_restapi::ISseConnection::~ISseConnection |
( |
| ) |
|
|
virtualdefault |
◆ close()
| virtual void cpp_restapi::ISseConnection::close |
( |
| ) |
|
|
pure virtual |
Stop receiving events and close the SSE connection.
◆ subscribe()
| virtual void cpp_restapi::ISseConnection::subscribe |
( |
const std::string & | request, |
|
|
EventCallback | callback ) |
|
pure virtual |
Subscribe to an SSE endpoint.
- Parameters
-
| request | API endpoint path (e.g. "events" or "api/v1/events") |
| callback | function called for each received SSE event |
The documentation for this struct was generated from the following file: