grpc-go/examples/features/wait_for_ready
Arvind Bright 8320224ff0
.*: revive from unused_parameters (#7577)
2024-08-30 10:41:30 -07:00
..
README.md examples: wait_for_ready (#2503) 2018-12-13 16:13:38 -08:00
main.go .*: revive from unused_parameters (#7577) 2024-08-30 10:41:30 -07:00

README.md

Wait for ready example

This example shows how to enable "wait for ready" in RPC calls.

This code starts a server with a 2 seconds delay. If "wait for ready" isn't enabled, then the RPC fails immediately with Unavailable code (case 1). If "wait for ready" is enabled, then the RPC waits for the server. If context dies before the server is available, then it fails with DeadlineExceeded (case 3). Otherwise it succeeds (case 2).

Run the example

go run main.go