Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix documentation about RetryStrategy #14450

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

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions http_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,9 @@ original HTTP client::
$client = new RetryableHttpClient(HttpClient::create());

The ``RetryableHttpClient`` uses a
:class:`Symfony\\Component\\HttpClient\\Retry\\RetryDeciderInterface` to
decide if the request should be retried, and a
:class:`Symfony\\Component\\HttpClient\\Retry\\RetryBackOffInterface` to
define the waiting time between each retry.
:class:`Symfony\\Component\\HttpClient\\Retry\\RetryStrategyInterface` to
decide if the request should be retried, and to define the waiting time between
each retry.

HTTP Proxies
~~~~~~~~~~~~
Expand Down
55 changes: 19 additions & 36 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ Configuration

* :ref:`retry_failed <reference-http-client-retry-failed>`

* `backoff_service`_
* `decider_service`_
* `retry_strategy`_
* :ref:`enabled <reference-http-client-retry-enabled>`
* `delay`_
* `http_codes`_
Expand All @@ -157,8 +156,7 @@ Configuration

* :ref:`retry_failed <reference-http-client-retry-failed>`

* `backoff_service`_
* `decider_service`_
* `retry_strategy`_
* :ref:`enabled <reference-http-client-retry-enabled>`
* `delay`_
* `http_codes`_
Expand Down Expand Up @@ -780,8 +778,7 @@ will automatically retry failed HTTP requests.
http_client:
# ...
retry_failed:
# backoff_service: app.custom_backoff
# decider_service: app.custom_decider
# retry_strategy: app.custom_strategy
http_codes: [429, 500]
max_retries: 2
delay: 1000
Expand Down Expand Up @@ -826,21 +823,6 @@ in the `Microsoft NTLM authentication protocol`_. The value of this option must
follow the format ``username:password``. This authentication mechanism requires
using the cURL-based transport.

backoff_service
...............

**type**: ``string``

.. versionadded:: 5.2

The ``backoff_service`` option was introduced in Symfony 5.2.

The service id used to compute the time to wait between retries. By default, it
uses an instance of
:class:`Symfony\\Component\\HttpClient\\Retry\\ExponentialBackOff` configured
with ``delay``, ``max_delay``, ``multiplier`` and ``jitter`` options. This
class has to implement :class:`Symfony\\Component\\HttpClient\\Retry\\RetryBackOffInterface`.

base_uri
........

Expand Down Expand Up @@ -909,21 +891,6 @@ ciphers
A list of the names of the ciphers allowed for the SSL/TLS connections. They
can be separated by colons, commas or spaces (e.g. ``'RC4-SHA:TLS13-AES-128-GCM-SHA256'``).

decider_service
...............

**type**: ``string``

.. versionadded:: 5.2

The ``decider_service`` option was introduced in Symfony 5.2.

The service id used to decide if a request should be retried. By default, it
uses an instance of
:class:`Symfony\\Component\\HttpClient\\Retry\\HttpStatusCodeDecider` configured
with the ``http_codes`` option. This class has to implement
:class:`Symfony\\Component\\HttpClient\\Retry\\RetryDeciderInterface`.

delay
.....

Expand Down Expand Up @@ -1124,6 +1091,22 @@ client and to make your tests easier.
The value of this option is an associative array of ``domain => IP address``
(e.g ``['symfony.com' => '46.137.106.254', ...]``).

retry_strategy
...............

**type**: ``string``

.. versionadded:: 5.2

The ``retry_strategy`` option was introduced in Symfony 5.2.

The service is used to decide if a request should be retried and to compute the
time to wait between retries. By default, it uses an instance of
:class:`Symfony\\Component\\HttpClient\\Retry\\GenericRetryStrategy` configured
with ``http_codes``, ``delay``, ``max_delay``, ``multiplier`` and ``jitter``
options. This class has to implement
:class:`Symfony\\Component\\HttpClient\\Retry\\RetryStrategyInterface`.

scope
.....

Expand Down