Extract constant for default sender endpoint#144
Merged
SergeyKanzhelev merged 1 commit intomicrosoft:developfrom Feb 1, 2019
CatalystCode:default-endpoint-url
Merged
Extract constant for default sender endpoint#144SergeyKanzhelev merged 1 commit intomicrosoft:developfrom CatalystCode:default-endpoint-url
SergeyKanzhelev merged 1 commit intomicrosoft:developfrom
CatalystCode:default-endpoint-url
Conversation
This change brings three main benefits:
1) Clients can now programmatically access the value of the default
sender endpoint, for example to forward requests to it. This benefit
is demonstrated by the changes to the test code.
2) Avoid copy/paste of the endpoint URL between async and sync senders.
3) Defaulting the service_endpoint_url to None instead of the string
value and checking against null later to look up the default endpoint
url means that the class now supports use-cases like
`Sender(os.getenv('SERVICE_URL'))` which simplifies client code that
may want to optionally override the service url. This benefit is
demonstrated by the changes to the Django and Flask integrations.
SergeyKanzhelev
approved these changes
Feb 1, 2019
Contributor
|
sorry for delay. I'll also add a line to |
Contributor
Author
|
Thanks for the merge! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change brings three main benefits:
Clients can now programmatically access the value of the default sender endpoint, for example to forward requests to it. This benefit is demonstrated by the changes to the test code.
Avoid copy/paste of the endpoint URL between async and sync senders.
Defaulting the service_endpoint_url to None instead of the string value and checking against null later to look up the default endpoint url means that the class now supports use-cases like
sender = AsynchronousSender(os.getenv('APPINSIGHTS_ENDPOINT_URL'))which simplifies client code that may want to optionally override the service url. This benefit is demonstrated by the changes to the Django and Flask integrations.