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

Making HttpClient static again when not using in tests #526

Merged
merged 2 commits into from
Aug 6, 2021

Conversation

eddynaka
Copy link
Collaborator

@eddynaka eddynaka commented Aug 5, 2021

@michaelcfanning , this is the change we talked yesterday at night.
We will have two httpclients, one that is static and one private.
The static will be normally used.
The private will only be used during tests.

if (httpClient == null)
// The httpClient is the property that will be used for tests only.
if (httpClient != null)
{
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we be using this. as a prefix here? to make it clear we're referencing instance data on the class?

i like this pattern, or we could use m_ as a prefix to make that distinction clear. what do we do elsewhere?

@@ -324,24 +327,30 @@ internal void SetHttpClient(HttpClient client)

protected HttpClient CreateOrUseCachedHttpClient()
Copy link
Member

Choose a reason for hiding this comment

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

CreateOrUseCachedHttpClient

Change this name to CreateOrRetrieveCachedHttpClient

Copy link
Member

@michaelcfanning michaelcfanning left a comment

Choose a reason for hiding this comment

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

:shipit:

@eddynaka eddynaka enabled auto-merge (squash) August 6, 2021 10:46
@eddynaka eddynaka merged commit 640f7f6 into main Aug 6, 2021
@eddynaka eddynaka deleted the users/ednakamu/making-httpclient-static-again branch August 6, 2021 10:53
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.

None yet

2 participants