diff options
Diffstat (limited to 'docs/backends')
-rw-r--r-- | docs/backends/custom.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/backends/custom.rst b/docs/backends/custom.rst index cca6a72..17571e1 100644 --- a/docs/backends/custom.rst +++ b/docs/backends/custom.rst @@ -102,7 +102,7 @@ Handling retries is a complex problem when it comes to HTTP requests. When is a * only idempotent HTTP methods (such as ``GET``) could potentially be retried * some HTTP status codes might also be retryable (e.g. ``500 Internal Server Error`` or ``503 Service Unavailable``) -In some cases it's possible to implement a generic retry mechanism; such a mechanism should take into account logging, metrics, limiting the number of retries and a backoff mechanism. These mechanisms could be quite simple, or involve e.g. retry budges (see `Finagle's <https://twitter.github.io/finagle/guide/Clients.html#retries>`_ documentation on retries). In sttp, it's possible to recover from errors using the ``responseMonad``. A starting point for a retrying backend could be:: +In some cases it's possible to implement a generic retry mechanism; such a mechanism should take into account logging, metrics, limiting the number of retries and a backoff mechanism. These mechanisms could be quite simple, or involve e.g. retry budgets (see `Finagle's <https://twitter.github.io/finagle/guide/Clients.html#retries>`_ documentation on retries). In sttp, it's possible to recover from errors using the ``responseMonad``. A starting point for a retrying backend could be:: import com.softwaremill.sttp.{MonadError, Request, Response, SttpBackend} @@ -137,4 +137,4 @@ In some cases it's possible to implement a generic retry mechanism; such a mecha override def responseMonad: MonadError[R] = delegate.responseMonad } -Note that some backends also have built-in retry mechanisms, e.g. `akka-http <https://doc.akka.io/docs/akka-http/current/scala/http/client-side/host-level.html#retrying-a-request>`_ or `OkHttp <http://square.github.io/okhttp>`_ (see the builder's ``retryOnConnectionFailure`` method).
\ No newline at end of file +Note that some backends also have built-in retry mechanisms, e.g. `akka-http <https://doc.akka.io/docs/akka-http/current/scala/http/client-side/host-level.html#retrying-a-request>`_ or `OkHttp <http://square.github.io/okhttp>`_ (see the builder's ``retryOnConnectionFailure`` method). |