MCPcopy Create free account
hub / github.com/apache/fory / pb_aggregate

Function pb_aggregate

integration_tests/grpc_tests/rust/interop/src/main.rs:759–779  ·  view source on GitHub ↗

Builds the aggregate protobuf response used by client-streaming RPCs.

(requests: &[GrpcPbRequest])

Source from the content-addressed store, hash-verified

757
758// Builds the aggregate protobuf response used by client-streaming RPCs.
759fn pb_aggregate(requests: &[GrpcPbRequest]) -> GrpcPbResponse {
760 GrpcPbResponse {
761 id: format!(
762 "client:{}",
763 requests
764 .iter()
765 .map(|request| request.id.as_str())
766 .collect::<Vec<_>>()
767 .join("+")
768 ),
769 count: requests.iter().map(|request| request.count).sum(),
770 payload: Some(grpc_pb_response::Payload::Text(format!(
771 "client:{}",
772 requests
773 .iter()
774 .map(|request| request.id.as_str())
775 .collect::<Vec<_>>()
776 .join("+")
777 ))),
778 }
779}
780
781async fn exercise_pb(channel: Channel) -> AnyResult<()> {
782 let mut client = PbGrpcServiceClient::new(channel);

Callers 1

client_stream_messageMethod · 0.70

Calls 3

SomeFunction · 0.85
TextClass · 0.85
mapMethod · 0.45

Tested by

no test coverage detected