The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)
https://grpc.io/
|
1 year ago | |
---|---|---|
.. | ||
BUILD | 1 year ago | |
CMakeLists.txt | 1 year ago | |
README.md | 1 year ago | |
client.cc | 1 year ago | |
server.cc | 1 year ago |
README.md
Deadline Example
Overview
This example shows you how to use deadline when calling calls.
Try it!
Once you have working gRPC, you can build this example using either bazel or cmake.
Run the server, which will listen on port 50051:
$ ./server
Run the client (in a different terminal):
$ ./client
To simulate the test scenario, the test server implements following functionalities:
- Response Delay: The server intentionally delays its response for
delay
request messages to induce timeout conditions. - Deadline Propagation: Upon receiving a request with the
[propagate me]
prefix, the server forwards it back to itselt. This simulates the propagation of deadlines within the system.
If things go smoothly, you will see the client output:
[Successful request] wanted = 0, got = 0
[Exceeds deadline] wanted = 4, got = 4
[Successful request with propagated deadline] wanted = 0, got = 0
[Exceeds propagated deadline] wanted = 4, got = 4