gRPC Examples
The grpc
folder contains examples for
the gRPC application protocol. We provide
implementations for the examples proto services provided by
gRPC.
Hello World
Implementation for the gRPC hello world example.
Asynchronous
This example demonstrates asynchronous request processing for the hello world API using the HelloWorldServer and a HelloWorldClient
Blocking
This example demonstrates blocking request processing for the hello world API using the BlockingHelloWorldServer and a BlockingHelloWorldClient
Route guide
Implementation for the gRPC route guide example.
Asynchronous
Asynchronous processing for different APIs in the route guide service are demonstrated using the RouteGuideServer and the following clients:
-
RouteGuideClient -
getFeature
API that uses the aggregated programming paradigm. -
RouteGuideRequestStreamingClient -
recordRoute
API that uses the request streaming programming paradigm. -
RouteGuideResponseStreamingClient -
recordRoute
API that uses the response streaming programming paradigm. -
RouteGuideStreamingClient -
recordRoute
API that uses the bi-directional streaming programming paradigm.
Blocking
Blocking processing for different APIs in the route guide service are demonstrated using the BlockingRouteGuideServer and the following clients:
-
BlockingRouteGuideClient -
getFeature
API that uses the aggregated programming paradigm. -
BlockingRouteGuideRequestStreamingClient -
recordRoute
API that uses the request streaming programming paradigm. -
BlockingRouteGuideResponseStreamingClient -
recordRoute
API that uses the response streaming programming paradigm. -
BlockingRouteGuideStreamingClient -
recordRoute
API that uses the bi-directional streaming programming paradigm.
Compression
Extends the async "Hello World" example to demonstrate compression of the response body.
-
CompressionExampleServer - Waits for hello request from the client and responds with a compressed greeting response.
-
CompressionExampleClient - Sends a hello request to the server and receives a compressed greeting response.
Protoc Options
This example demonstrates how options for the servicetalk-grpc-protoc plugin can be used. See protoc-options for more details.