Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpClient] Addmax_retries option toRetryableHttpClient#50240

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:6.4fromdanielburger1337:httpclient-no-retry
Jun 9, 2023
Merged

[HttpClient] Addmax_retries option toRetryableHttpClient#50240

nicolas-grekas merged 1 commit intosymfony:6.4fromdanielburger1337:httpclient-no-retry
Jun 9, 2023

Conversation

@danielburger1337
Copy link
Contributor

@danielburger1337danielburger1337 commentedMay 4, 2023
edited by nicolas-grekas
Loading

QA
Branch?6.4
Bug fix?no
New feature?yes
Deprecations?no
TicketsN/A
LicenseMIT
Doc PRsymfony/symfony-docs#18288

Added amax_retries option to RetryableHttpClient that allows the user to configure the RetryableHttpClient on a per request level, which is especially useful whenretry_failed was configured for the globalhttp_client service.

<?phpuseSymfony\Component\HttpClient\HttpClient;useSymfony\Component\HttpClient\RetryableHttpClient;$client = HttpClient::create();$client =newRetryableHttpClient($client,null,3);$client->request('GET','/foo-bar', ['max_retries' =>1// 0 disables retrying]);// $client = $client->withOptions(['max_retries' => 1]);

ro0NL and javiereguiluz reacted with thumbs up emoji
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedMay 5, 2023
edited
Loading

What about addingmax_retries instead? this would be more flexible.
Note that this doesn't need to be an "extra" option - it shouldn't actually.
This will need to override thewithOptions method also.
You might want to take some inspiration from UriTemplateHttpClient, which also manages its own option.

@danielburger1337
Copy link
ContributorAuthor

What about addingmax_retries instead? this would be more flexible. Not that this doesn't need to be an "extra" option - it shouldn't actually. This will need to override thewithOptions method also. You might want to take some inspiration from UriTemplateHttpClient, which also manages its own option.

Yes, this would be much more flexible approach and I like it!

To be extra clear, would this option overide themaxRetries property of the RetryableHttpClient when cloned?
Because otherwise I'm not quite sure what you mean.

@nicolas-grekas
Copy link
Member

Yes, it would override it indeed.

@danielburger1337danielburger1337 changed the title[HttpClient] Add "no_retry" option to RetryableHttpClient[HttpClient] Add "max_retries" option to RetryableHttpClientMay 5, 2023
@OskarStark
Copy link
Contributor

OskarStark commentedMay 6, 2023
edited
Loading

Can you please update the pr header? You still mention no_retry. Thanks

@danielburger1337
Copy link
ContributorAuthor

Can you please update the pr header? You still mention no_retry. Thanks

What do you mean by PR header? Do you mean my original PR description?

Sorry, I never heard that term before.

@OskarStark
Copy link
Contributor

Yes the PR description and the code example. Thanks

@danielburger1337
Copy link
ContributorAuthor

Yes the PR description and the code example. Thanks

Done

OskarStark reacted with rocket emoji

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

Look good to me thanks. I just have a minor comment.

danielburger1337 reacted with thumbs up emoji
@OskarStarkOskarStark changed the title[HttpClient] Add "max_retries" option to RetryableHttpClient[HttpClient] Addmax_retries option toRetryableHttpClientMay 16, 2023
@nicolas-grekasnicolas-grekas modified the milestones:6.3,6.4May 23, 2023
@nicolas-grekas
Copy link
Member

Thank you@danielburger1337.

danielburger1337 reacted with rocket emoji

@nicolas-grekasnicolas-grekas merged commit52a9292 intosymfony:6.4Jun 9, 2023
OskarStark added a commit to symfony/symfony-docs that referenced this pull requestJun 9, 2023
…tryableHttpClient` (danielburger1337)This PR was submitted for the 6.3 branch but it was merged into the 6.4 branch instead.Discussion----------[HttpClient] Add `max_retries` setting docs on the `RetryableHttpClient`References [#50240](symfony/symfony#50240)Commits-------bf57a3e Add 'max_retries' setting docs on the RetryableHttpClient
This was referencedOct 21, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@fancywebfancywebfancyweb approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

5 participants

@danielburger1337@nicolas-grekas@OskarStark@fancyweb@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp