Documentation Index Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
GatewayProtocol
Defined in the gateway module.
Rust AI Agent SDK
Protocol for gateway/control plane implementations. The gateway coordinates communication between clients and agents, manages sessions, and provides health/presence tracking.
Methods
is_running
fn is_running ( & self ) -> bool
Whether the gateway is currently running.
port
Port the gateway is listening on.
host
Host the gateway is bound to.
start
async fn start ( &mut self ) -> Result <()>
Start the gateway server.
stop
async fn stop ( &mut self ) -> Result <()>
Stop the gateway server.
register_agent
fn register_agent ( &mut self , agent : Arc < Agent >, agent_id : Option < String >) -> String
Register an agent with the gateway.
Parameters:
Name Type agentArc<Agent>agent_idOption<String>
unregister_agent
fn unregister_agent ( &mut self , agent_id : & str ) -> bool
Unregister an agent from the gateway.
Parameters:
get_agent
fn get_agent ( & self , agent_id : & str ) -> Option < Arc < Agent >>
Get a registered agent by ID.
Parameters:
list_agents
fn list_agents ( & self ) -> Vec < String >
List all registered agent IDs.
create_session
fn create_session (
&mut self ,
agent_id : & str ,
client_id : Option < String >,
session_id : Option < String >,
) -> Result < Box < dyn GatewaySessionProtocol >>
Create a new session.
Parameters:
Name Type agent_id&strclient_idOption<String>session_idOption<String>
get_session
fn get_session ( & self , session_id : & str ) -> Option < & dyn GatewaySessionProtocol >
Get a session by ID.
Parameters:
close_session
fn close_session ( &mut self , session_id : & str ) -> bool
Close a session.
Parameters:
list_sessions
fn list_sessions ( & self , agent_id : Option < & str >) -> Vec < String >
List session IDs, optionally filtered by agent.
Parameters:
Name Type agent_idOption<&str>
emit
async fn emit ( & self , event : GatewayEvent ) -> Result <()>
Emit an event to registered handlers.
Parameters:
Name Type eventGatewayEvent
broadcast
async fn broadcast ( & self , event : GatewayEvent , exclude : Option < Vec < String >>) -> Result <()>
Broadcast an event to all connected clients.
Parameters:
Name Type eventGatewayEventexcludeOption<Vec<String>>
health
fn health ( & self ) -> GatewayHealth
Get gateway health status.
Source
View on GitHub praisonai/src/gateway/mod.rs at line 0