move Duration doc to general/util.rst

move migration guide links one level down
This commit is contained in:
Roland 2011-04-23 11:04:02 +02:00
parent d55c9cea10
commit 2adc45cf2c
4 changed files with 63 additions and 45 deletions

View file

@ -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

View file

@ -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

View file

@ -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()));

View file

@ -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()));