Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::SSETransport Class Reference

SSE transport: HTTP GET for event stream, POST for requests. More...

#include <entropic/mcp/transport_sse.h>

Inheritance diagram for entropic::SSETransport:
Collaboration diagram for entropic::SSETransport:

Public Member Functions

 SSETransport (std::string url, uint32_t default_timeout_ms=30000)
 Construct with SSE endpoint URL.
 
 ~SSETransport () override
 Destructor — ensures reader thread is stopped.
 
bool open () override
 Connect to SSE endpoint and start reader thread.
 
void close () override
 Stop SSE reader and close HTTP client.
 
std::string send_request (const std::string &request_json, uint32_t timeout_ms=0) override
 POST a JSON-RPC request and wait for matching response.
 
bool is_connected () const override
 Check if SSE stream is connected.
 
- Public Member Functions inherited from entropic::Transport
virtual void interrupt ()
 Abort any in-flight send_request() call ASAP.
 

Detailed Description

SSE transport: HTTP GET for event stream, POST for requests.

Background thread reads SSE events; data fields parsed as JSON-RPC responses and matched to pending requests by id. send_request() POSTs the request and waits on a condition variable for the response.

Version
1.8.7

Definition at line 39 of file transport_sse.h.

Constructor & Destructor Documentation

◆ SSETransport()

entropic::SSETransport::SSETransport ( std::string  url,
uint32_t  default_timeout_ms = 30000 
)
explicit

Construct with SSE endpoint URL.

Parameters
urlSSE endpoint (e.g., "http://127.0.0.1:6277/sse").
default_timeout_msDefault timeout for send_request.
Version
1.8.7
Parameters
urlSSE endpoint URL.
default_timeout_msDefault request timeout.

Definition at line 27 of file transport_sse.cpp.

◆ ~SSETransport()

entropic::SSETransport::~SSETransport ( )
override

Destructor — ensures reader thread is stopped.

Definition at line 38 of file transport_sse.cpp.

Member Function Documentation

◆ close()

void entropic::SSETransport::close ( )
overridevirtual

Stop SSE reader and close HTTP client.

Version
1.8.7

Implements entropic::Transport.

Definition at line 127 of file transport_sse.cpp.

◆ is_connected()

bool entropic::SSETransport::is_connected ( ) const
overridevirtual

Check if SSE stream is connected.

Returns
true if connected.
Version
1.8.7
Returns
true if connected.

Implements entropic::Transport.

Definition at line 254 of file transport_sse.cpp.

◆ open()

bool entropic::SSETransport::open ( )
overridevirtual

Connect to SSE endpoint and start reader thread.

Returns
true on success.
Version
1.8.7
Returns
true on success.

Implements entropic::Transport.

Definition at line 90 of file transport_sse.cpp.

◆ send_request()

std::string entropic::SSETransport::send_request ( const std::string &  request_json,
uint32_t  timeout_ms = 0 
)
overridevirtual

POST a JSON-RPC request and wait for matching response.

Parameters
request_jsonJSON-RPC request string.
timeout_msTimeout (0 = default).
Returns
Response string, or empty on error/timeout.
Version
1.8.7
Parameters
request_jsonJSON-RPC request string.
timeout_msTimeout (0 = default).
Returns
Response string, or empty on error/timeout.

Implements entropic::Transport.

Definition at line 229 of file transport_sse.cpp.


The documentation for this class was generated from the following files: