diff --git a/akka-docs/general/index.rst b/akka-docs/general/index.rst index 1d716ed63a..5b0e3c24d6 100644 --- a/akka-docs/general/index.rst +++ b/akka-docs/general/index.rst @@ -2,10 +2,7 @@ General ======= .. toctree:: - :maxdepth: 1 + :maxdepth: 2 - migration-guide-0.7.x-0.8.x - migration-guide-0.8.x-0.9.x - migration-guide-0.9.x-0.10.x - migration-guide-0.10.x-1.0.x - migration-guide-1.0.x-1.1.x + migration-guides + util diff --git a/akka-docs/general/migration-guides.rst b/akka-docs/general/migration-guides.rst new file mode 100644 index 0000000000..204b7a22e5 --- /dev/null +++ b/akka-docs/general/migration-guides.rst @@ -0,0 +1,11 @@ +Migration Guides +================ + +.. toctree:: + :maxdepth: 1 + + migration-guide-0.7.x-0.8.x + migration-guide-0.8.x-0.9.x + migration-guide-0.9.x-0.10.x + migration-guide-0.10.x-1.0.x + migration-guide-1.0.x-1.1.x diff --git a/akka-docs/general/util.rst b/akka-docs/general/util.rst new file mode 100644 index 0000000000..bb0f61e778 --- /dev/null +++ b/akka-docs/general/util.rst @@ -0,0 +1,49 @@ +######### +Utilities +######### + +.. sidebar:: Contents + + .. contents:: :local: + +This section of the manual describes miscellaneous utilities which are provided +by Akka and used in multiple places. + +.. _Duration: + +Duration +======== + +Durations are used throughout the Akka library, wherefore this concept is +represented by a special data type, :class:`Duration`. Values of this type may +represent infinite (:obj:`Duration.Inf`, :obj:`Duration.MinusInf`) or finite +durations, where the latter are constructable using a mini-DSL: + +.. code-block:: scala + + import akka.util.duration._ // notice the small d + + val fivesec = 5.seconds + val threemillis = 3.millis + val diff = fivesec - threemillis + assert (diff < fivesec) + +.. note:: + + You may leave out the dot if the expression is clearly delimited (e.g. + within parentheses or in an argument list), but it is recommended to use it + if the time unit is the last token on a line, otherwise semi-colon inference + might go wrong, depending on what starts the next line. + +Java provides less syntactic sugar, so you have to spell out the operations as +method calls instead: + +.. code-block:: java + + final Duration fivesec = Duration.create(5, "seconds"); + final Duration threemillis = Duration.parse("3 millis"); + final Duration diff = fivesec.minus(threemillis); + assert (diff.lt(fivesec)); + assert (Duration.Zero().lt(Duration.Inf())); + + diff --git a/akka-docs/scala/testing.rst b/akka-docs/scala/testing.rst index ecf86720db..9238cfd198 100644 --- a/akka-docs/scala/testing.rst +++ b/akka-docs/scala/testing.rst @@ -332,42 +332,3 @@ has to offer: exception stack traces - Exclusion of certain classes of dead-lock scenarios -.. _Duration: - -Duration -======== - -Durations are used throughout the Akka library, wherefore this concept is -represented by a special data type, :class:`Duration`. Values of this type may -represent infinite (:obj:`Duration.Inf`, :obj:`Duration.MinusInf`) or finite -durations, where the latter are constructable using a mini-DSL: - -.. code-block:: scala - - import akka.util.duration._ // notice the small d - - val fivesec = 5.seconds - val threemillis = 3.millis - val diff = fivesec - threemillis - assert (diff < fivesec) - -.. note:: - - You may leave out the dot if the expression is clearly delimited (e.g. - within parentheses or in an argument list), but it is recommended to use it - if the time unit is the last token on a line, otherwise semi-colon inference - might go wrong, depending on what starts the next line. - -Java provides less syntactic sugar, so you have to spell out the operations as -method calls instead: - -.. code-block:: java - - final Duration fivesec = Duration.create(5, "seconds"); - final Duration threemillis = Duration.parse("3 millis"); - final Duration diff = fivesec.minus(threemillis); - assert (diff.lt(fivesec)); - assert (Duration.Zero().lt(Duration.Inf())); - - -