pekko/akka-docs/rst/java/http/routing-dsl/directives/timeout-directives/withoutRequestTimeout.rst
gosubpl 4b89fcd643 +doc #20466 akka http java dsl example snippets timeout directives (#20812)
* #20466 added checks to the TimeoutDirectivesExampleSpec

* #20466 added missing Java directive wrapper, added Java test, added some comments to Scala spec

* #20466 test minor fixes (typos, comments, unused code)

* #20466 replaced placeholders with proper snippets in Java docs

* #20466 added proper withRequestTimeout example to JavaTestServer

* #20466 comment - clarifies the request-timeout = infinite case

* #20466 post-review changes (#20812)
2016-06-22 01:55:28 +02:00

24 lines
No EOL
1 KiB
ReStructuredText

.. _-withoutRequestTimeout-java-:
withoutRequestTimeout
=====================
Description
-----------
This directive enables "late" (during request processing) control over the :ref:`request-timeout-java` feature in Akka HTTP.
It is not recommended to turn off request timeouts using this method as it is inherently racy and disabling request timeouts
basically turns off the safety net against programming mistakes that it provides.
.. warning::
Please note that setting the timeout from within a directive is inherently racy (as the "point in time from which
we're measuring the timeout" is already in the past (the moment we started handling the request), so if the existing
timeout already was triggered before your directive had the chance to change it, an timeout may still be logged.
For more information about various timeouts in Akka HTTP see :ref:`http-timeouts-java`.
Example
-------
.. includecode2:: ../../../../code/docs/http/javadsl/server/directives/TimeoutDirectivesExamplesTest.java
:snippet: withoutRequestTimeout