restore behavior of Future.as[T] and .asSilently[T] (fixes #1088)

- implement both methods equivalently directly on Future
- remove implicit conversion futureToAnyOptionAsTypedOption
- update docs accordingly
This commit is contained in:
Roland 2011-08-09 21:37:39 +02:00
parent f894ae1818
commit cdae21e07c
3 changed files with 36 additions and 13 deletions

View file

@ -287,8 +287,11 @@ processing another message on this actor).
For this purpose, there is the method :meth:`Future.as[T]` which waits until
either the future is completed or its timeout expires, whichever comes first.
The result is then inspected and returned as :class:`Some[T]` if it was
normally completed and the answers runtime type matches the desired type; in
all other cases :class:`None` is returned.
normally completed and the answers runtime type matches the desired type; if
the future contains an exception or the value cannot be cast to the desired
type, it will throw the exception or a :class:`ClassCastException` (if you want
to get :obj:`None` in the latter case, use :meth:`Future.asSilently[T]`). In
case of a timeout, :obj:`None` is returned.
.. code-block:: scala