Skip to content
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

Refactor some properties shared by all server-side call contexts into a common ServerCallContext protocol … #389

Merged
merged 2 commits into from
Mar 4, 2019

Conversation

MrMage
Copy link
Collaborator

@MrMage MrMage commented Mar 3, 2019

… , while renaming the existing ServerCallContext class to ServerCallContextBase.

Motivation: As opposed to all three other call types, unary calls are not passed an instance of the previous ServerCallContext class, but rather of the StatusOnlyCallContext protocol. If one wanted to create a method that uses only a call's event loop and request headers but wants to process all four types of calls, that was not possible before. With this change, such a method could simply accept an instance of ServerCallContext, which the call arguments provided to all four methods now conform to.

… a common `ServerCallContext` protocol, while renaming the existing `ServerCallContext` class to `ServerCallContextBase`.

Motivation: As opposed to all three other call types, unary calls are not passed an instance of the previous `ServerCallContext` class, but rather of the `StatusOnlyCallContext` protocol. If one wanted to create a method that uses only a call's event loop and request headers but wants to process all *four* types of calls, that was not possible before. With this change, such a method could simply accept an instance of `ServerCallContext`, which the call arguments provided to all four methods now conform to.
@MrMage MrMage requested a review from rebello95 March 3, 2019 15:47
@MrMage
Copy link
Collaborator Author

MrMage commented Mar 3, 2019

@glbrntt, looks like I can't request a review from you, but please take a look regardless.

@MrMage MrMage merged commit c082197 into master Mar 4, 2019
@MrMage MrMage deleted the server-call-context branch April 4, 2019 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants