Skip to content

Commit 91c8bea

Browse files
committed
Improve docs of 'toFuture'
1 parent 7e154a2 commit 91c8bea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/observables/BlockingObservable.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
251251
/**
252252
* Returns a `Future` representing the single value emitted by this `BlockingObservable`.
253253
*
254-
* `toFuture` throws an `IllegalArgumentException` if the `BlockingObservable` emits more than one item. If the
255-
* `BlockingObservable` may emit more than item, use `BlockingObservable.toList.toFuture`.
256-
*
257-
* `toFuture` throws an `NoSuchElementException` if the `BlockingObservable` is empty.
254+
* The returned `Future` will be completed with an `IllegalArgumentException` if the `BlockingObservable`
255+
* emits more than one item. And it will be completed with an `NoSuchElementException` if the `BlockingObservable`
256+
* is empty. Use `Observable.toSeq.toBlocking.toFuture` if you are not sure about the size of `BlockingObservable`
257+
* and do not want to handle these `Exception`s.
258258
*
259259
* <img width="640" height="395" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.toFuture.png">
260260
*

0 commit comments

Comments
 (0)