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:
parent
f894ae1818
commit
cdae21e07c
3 changed files with 36 additions and 13 deletions
|
|
@ -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 answer’s runtime type matches the desired type; in
|
||||
all other cases :class:`None` is returned.
|
||||
normally completed and the answer’s 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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue