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

Allow using custom client #114

Merged
merged 4 commits into from
Aug 30, 2024
Merged

Allow using custom client #114

merged 4 commits into from
Aug 30, 2024

Conversation

RossyWhite
Copy link
Contributor

It would be useful to make it possible to use custom client. (to customize networking options)

@RossyWhite
Copy link
Contributor Author

@gsquire could you please review it?

@gsquire
Copy link
Owner

gsquire commented Aug 23, 2024

Hey, I'm currently on vacation so I won't get to this until next week. Sorry!

src/v3.rs Outdated
@@ -217,6 +217,17 @@ impl Sender {
self.host = host.into();
}

/// Sets client to use for the API. This is useful if you want to customize the client.
pub fn set_client(&mut self, client: Client) {
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe it would be better to allow new to accept an Option<Client> and just unwrap it or use a default one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gsquire

Is this what you meant? b5ea713

Copy link
Owner

Choose a reason for hiding this comment

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

Exactly. We'll need a new_blocking function as well so users can configure that client. Otherwise this LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added! @gsquire

62358ce

@gsquire gsquire merged commit 3e31294 into gsquire:master Aug 30, 2024
4 checks passed
@gsquire
Copy link
Owner

gsquire commented Aug 30, 2024

Thanks! I will publish this as version 0.22.0 shortly.

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.

2 participants