Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Python Cancellation Example #19465
Add Python Cancellation Example #19465
Changes from 17 commits
32944fd
335e655
7dccc07
b31431a
244279c
b6a5e94
c9e83db
4ee154d
82aa406
cdae8ca
b9cc2c2
4c852bf
b122997
8f1bfda
dc8dba8
93d6344
786a3ac
edbddf2
81f4203
fed1c62
2bf4d50
42b2fe1
7fa7f93
4100084
7486026
25f3439
1db141a
915e97b
61c2f0c
ba39c92
79e78d1
805afe6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
signal
mechanism is not a necessary step for cancellation. I think a simplefuture.cancel()
is capable of convey the idea of cancelling an unary request.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline. If you have a better way to motivate why you would cancel on the client side, I'm more than happy to give it a shot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is specific to our own implementation... Ideally, we should get rid of this bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. And I have added a TODO in the example to get rid of the workaround once the bug has been fixed. But until it has, this is the only way that this can be accomplished using our library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, this is a workaround for our implementation defect. It's not that ideal to recommend it to our users...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree it would be better to fix the bug. But until then, a workaround is the next best thing. This is an example. It can always be changed once our library supports a simpler workflow.