Skip to content

Improve HttpClient usage for better efficiency#5

Open
Yortw wants to merge 1 commit into
danvy:masterfrom
Yortw:master
Open

Improve HttpClient usage for better efficiency#5
Yortw wants to merge 1 commit into
danvy:masterfrom
Yortw:master

Conversation

@Yortw

@Yortw Yortw commented Jan 29, 2016

Copy link
Copy Markdown
  • Reuse single instance of HttpClient across calls to make connection pooling effective. Implement Dispose pattern on Klout service to allow client code to control connection lifetimes properly.
  • Enable gzip compression on default HttpClient instance.
  • Enable constructor injection of HttpClient instance to use.
  • Apply ConfigureAwait(false) to internal async calls to reduce async overhead.
  • Changed internal static strings that should never change to either constants or static readonly declarations.

Should take care of problems in issue #4

Sorry, just realised I forgot to branch first. Can redo in a branch if required.

* Reuse single instance of HttpClient across calls to make connection pooling effective. Implement Dispose pattern on Klout service to allow client code to control connection lifetimes properly.
* Enable gzip compression on default HttpClient instance.
* Enable constructor injection of HttpClient instance to use.
* Apply ConfigureAwait(false) to internal async calls to reduce async overhead.
* Changed internal static strings that should never change to either constants or static *readonly* declarations.

Should take care of problems in issue danvy#4
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.

1 participant