NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::a2a::A2AServer Class Reference

HTTP server exposing a NeoGraph as an A2A agent. More...

#include <server.h>

Public Member Functions

 A2AServer (std::shared_ptr< neograph::graph::GraphEngine > engine, AgentCard card, std::shared_ptr< GraphAgentAdapter > adapter={})
 
bool is_running () const
 True once start_async() has the server listening.
 
int port () const
 Bound port — useful when caller passed 0 to bind a free port.
 
bool start (const std::string &host, int port)
 Bind + listen.
 
bool start_async (const std::string &host, int port)
 Bind + spawn a worker thread; returns when the server is ready to accept connections.
 
void stop ()
 Signal the server to stop accepting connections and join.
 

Detailed Description

HTTP server exposing a NeoGraph as an A2A agent.

card.name = "my-agent";
card.url = "http://0.0.0.0:8080/";
a2a::A2AServer server(my_engine, card);
server.start("0.0.0.0", 8080); // blocks until stop()
HTTP server exposing a NeoGraph as an A2A agent.
Definition server.h:68
Subset of AgentCard required to interact (spec §5.5).
Definition types.h:160
std::string url
primary endpoint
Definition types.h:163

Definition at line 68 of file server.h.

Constructor & Destructor Documentation

◆ A2AServer()

neograph::a2a::A2AServer::A2AServer ( std::shared_ptr< neograph::graph::GraphEngine engine,
AgentCard  card,
std::shared_ptr< GraphAgentAdapter adapter = {} 
)
Parameters
engineThe graph engine that handles incoming messages.
cardDiscovery payload returned at /.well-known/agent-card.json.
adapterOptional input/output mapping override.

Member Function Documentation

◆ start()

bool neograph::a2a::A2AServer::start ( const std::string &  host,
int  port 
)

Bind + listen.

Blocks the calling thread.

Returns
false if bind/listen fails.

◆ start_async()

bool neograph::a2a::A2AServer::start_async ( const std::string &  host,
int  port 
)

Bind + spawn a worker thread; returns when the server is ready to accept connections.

Use stop() to shut down.


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