Skip to content

add HttpClientArc & set user-agent #81

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

Closed
wants to merge 5 commits into from

Conversation

ctaggart
Copy link
Contributor

@ctaggart ctaggart commented Nov 13, 2020

Continues from #80 and fixes #65. It is probably easiest to review #80 and ctaggart/autorust#86. This is the generated code.

use std::sync::Arc;

#[derive(Clone)]
pub struct HttpClientArc(Arc<reqwest::Client>);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we gain too much from this new type. What's the thought behind a new type instead of using Arc<Client> directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like it. It has some value. It gives us HttpClientArc::default(), which should still work when we change the internals to be HttpClient interface. I think it also communicates how the library should be used.

@ctaggart
Copy link
Contributor Author

I need to address ctaggart/autorust#86 first & then recreate this.

@ctaggart ctaggart closed this Nov 24, 2020
@ctaggart ctaggart deleted the http_pool_codegen branch November 24, 2020 01:50
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.

add User-Agent header
2 participants