aboutsummaryrefslogtreecommitdiff
path: root/examples/cpp/deadline/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cpp/deadline/README.md')
-rw-r--r--examples/cpp/deadline/README.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/cpp/deadline/README.md b/examples/cpp/deadline/README.md
new file mode 100644
index 0000000000..cfa8ee9b72
--- /dev/null
+++ b/examples/cpp/deadline/README.md
@@ -0,0 +1,35 @@
+# 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:
+
+```sh
+$ ./server
+```
+
+Run the client (in a different terminal):
+
+```sh
+$ ./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
+```