Skip to main content

Module grpc

Module grpc 

Source
Expand description

gRPC dispatcher for the A2A server.

GrpcDispatcher implements the tonic-generated A2aService trait, routing gRPC calls to the underlying crate::RequestHandler. JSON payloads are carried inside protobuf bytes fields, reusing the same serde types as the JSON-RPC and REST bindings.

§Configuration

Use GrpcConfig to control message size limits and compression.

§Example

use std::sync::Arc;
use a2a_protocol_server::dispatch::grpc::{GrpcDispatcher, GrpcConfig};
use a2a_protocol_server::RequestHandlerBuilder;
let handler = Arc::new(
    RequestHandlerBuilder::new(MyExec).build().unwrap()
);
let config = GrpcConfig::default();
let dispatcher = GrpcDispatcher::new(handler, config);
dispatcher.serve("127.0.0.1:50051").await?;

Structs§

A2aServiceServer
A2A gRPC service.
GrpcConfig
Configuration for the gRPC dispatcher.
GrpcDispatcher
gRPC dispatcher that routes A2A requests to a RequestHandler.