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

Add timeout option #239

Merged
merged 11 commits into from
Aug 6, 2024
Merged

Conversation

threema-donat
Copy link
Contributor

Adds the option to add a timeout after which a request will fail. PR #238 should be reviewed before this

Since the test and actual fn definition are equal and HTTP is allowed in every case, the test function is not needed anymore
Resolves warnings when creating docs and therefore makes failure on warning possible
@threema-donat
Copy link
Contributor Author

threema-donat commented Jul 3, 2024

I have pushed some commits that resolve warnings and added a job to run clippy linting to the CI pipeline. Furthermore, I disallowed warnings when they occur in the jobs. Please let me know if you want to have this as a separate PR.

Be aware that I renamed the config yup_oauth2_docsrs! I did not know how to resolve this warning without the rename and it seems to be a well-known config since reqwest does it the same way.

@dermesser
Copy link
Owner

Very nice! I like the new types, the weird hyper legacy client thing got on my nerves by now.

I noticed that DefaultHyperClient is not a good name, because this type implements HyperClientBuilder. If I have my way, we rename it to DefaultHyperClientBuilder - what do you think? (even though it creates annoyance for users after an update, but at least it's just a rename)

@@ -988,7 +994,61 @@ pub type DefaultAuthenticator =
yup_oauth2_docsrs,
doc(cfg(any(feature = "hyper-rustls", feature = "hyper-tls")))
)]
pub struct DefaultHyperClient;
#[derive(Default)]
Copy link
Owner

Choose a reason for hiding this comment

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

maybe move this to the client module as well? It looks general enough to make sense there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True! I moved the DefaultHyperClient as well as the CustomHyperClient to the client module and appended Builder to them.

@threema-donat threema-donat force-pushed the add_timeout_option branch 3 times, most recently from 65dea01 to ef846b6 Compare August 5, 2024 10:11
@threema-donat threema-donat force-pushed the add_timeout_option branch 2 times, most recently from 8b08db7 to 0d7dad9 Compare August 5, 2024 10:18
@dermesser dermesser merged commit 06f4f6f into dermesser:master Aug 6, 2024
8 checks passed
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