From cdae8ca6ad87c6fb94c7dc5dec7ba49f282b06aa Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 25 Jun 2019 11:11:03 -0700 Subject: [PATCH] Add intro about algorithm --- examples/python/cancellation/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/examples/python/cancellation/README.md b/examples/python/cancellation/README.md index e7f6b42106e..c50cc3b34df 100644 --- a/examples/python/cancellation/README.md +++ b/examples/python/cancellation/README.md @@ -2,6 +2,19 @@ RPCs may be cancelled by both the client and the server. +#### The Example + +In the example, we implement a silly algorithm. We search for bytestrings whose +hashes are similar to a given search string. For example, say we're looking for +the string "doctor". Our algorithm may `JrqhZVkTDoctYrUlXDbL6pfYQHU=` or +`RC9/7mlM3ldy4TdoctOc6WzYbO4=`. This is a brute force algorithm, so the server +performing the search must be conscious the resources it allows to each client +and each client must be conscientious of the resources demanded of the server. + +In particular, we ensure that client processes cancel the stream explicitly +before terminating and we ensure the server cancels RPCs that have gone on longer +than a certain number of iterations. + #### Cancellation on the Client Side A client may cancel an RPC for several reasons. Perhaps the data it requested