Skip to content

Support per-call unsuccessful response handlers #1101

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

Merged
merged 1 commit into from
Oct 12, 2017

Conversation

chrisdunelm
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 12, 2017
Copy link
Collaborator

@jskeet jskeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one nit.

Do we want to do the same for exception handlers at the same time, just for consistency? I'm not overly bothered, but it's worth considering.

if (request.Properties.TryGetValue(UnsuccessfulResponseHandlerKey, out var handlersValue) &&
handlersValue is List<IHttpUnsuccessfulResponseHandler> perCallHandlers)
{
handlers = handlers.Concat(perCallHandlers);

This comment was marked as spam.

This comment was marked as spam.

@chrisdunelm
Copy link
Contributor Author

I considered doing exception handlers as well, and decided not to until/if-ever we needed it.
But maybe you're right and it's best to do it now. Give me a few minutes...

@chrisdunelm
Copy link
Contributor Author

PTAL

Copy link
Collaborator

@jskeet jskeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Could potentially refactor the three parts of ConfigurableMessageHandler which are the same each time, but it's probably not worth it.

@chrisdunelm chrisdunelm merged commit bc36b40 into googleapis:master Oct 12, 2017
@chrisdunelm chrisdunelm deleted the atomic branch October 12, 2017 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants