-
Notifications
You must be signed in to change notification settings - Fork 234
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
Supporting client-side gRPC cancellation #393
Merged
+97
−33
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6c72805
Supporting client-side gRPC cancellation
tanmayv25 8047f9e
Address review comments
tanmayv25 dcc9e27
Wrap future to expose only cancel
tanmayv25 4b3774a
Update src/python/library/tritonclient/grpc/_client.py
tanmayv25 e568b72
Reverting changes in asyncio library
tanmayv25 6a18b6c
Format
tanmayv25 fbd5035
Make class variable real private
tanmayv25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Wrap future to expose only cancel
- Loading branch information
commit dcc9e2730ec906f45f14d545b1e3a6daa653892a
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
I think returning a future should replace the callback method. AFAIK, futures (or async/await) were added to replace the need for callbacks and we need to support one of them.
We could perhaps add another argument to
async_infer
namedreturn_future
with the default value ofFalse
. If it is set to True, this method would return a future and would never call the callback.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 makes sense. IMO we should also support cancelling request for callback based cancellation policy.
However, that is not possible without sending back the future. Maybe we can enforce that for accessing request cancellation feature, the user can not use callback based mode.
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.
Exactly, that's what I was thinking.
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.
I like the idea of returning Future with an additional method for retrieving the message. But I think it goes beyond the scope and can be addressed separately.
Additionally, we should be thinking of moving to aio clients at some point. Maintaining two library version is becoming heavy.