Unary
Greeter Service
The simplest pattern. The client sends one request and gets exactly one response back, like a normal function call.
1 request → 1 response
1. The contract
This is real gRPC code. It defines the service and messages.
greeter.proto
syntax = "proto3";
package demo;
// UNARY: one request in, one reply out
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply);
}
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}2. Live simulation
Watch how messages flow for this pattern.
// Press the button to start the Unary demo.