File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -3866,6 +3866,18 @@ object Observable {
3866
3866
))
3867
3867
}
3868
3868
3869
+ /**
3870
+ * Mirror the one Observable in an Iterable of several Observables that first emits an item.
3871
+ *
3872
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/amb.png">
3873
+ *
3874
+ * @param sources an Iterable of Observable sources competing to react first
3875
+ * @return an Observable that emits the same sequence of items as whichever of the source Observables
3876
+ * first emitted an item
3877
+ */
3878
+ def amb [T ](sources : Iterable [Observable [T ]]): Observable [T ] = {
3879
+ toScalaObservable[T ](rx.Observable .amb(sources.map(_.asJavaObservable.asInstanceOf [rx.Observable [T ]]).asJava))
3880
+ }
3869
3881
}
3870
3882
3871
3883
You can’t perform that action at this time.
0 commit comments