File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/observables Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,21 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
243
243
asJava.toIterable.asScala.toList: List [T ] // useless ascription because of compiler bug
244
244
}
245
245
246
+ /**
247
+ * Returns an `Iterable` that returns the latest item emitted by this `BlockingObservable`,
248
+ * waiting if necessary for one to become available.
249
+ *
250
+ * If this `BlockingObservable` produces items faster than `Iterator.next` takes them,
251
+ * `onNext` events might be skipped, but `onError` or `onCompleted` events are not.
252
+ *
253
+ * Note also that an `onNext` directly followed by `onCompleted` might hide the `onNext` event.
254
+ *
255
+ * @return an `Iterable` that always returns the latest item emitted by this `BlockingObservable`
256
+ */
257
+ def latest : Iterable [T ] = {
258
+ asJava.latest.asScala: Iterable [T ] // useless ascription because of compiler bug
259
+ }
260
+
246
261
}
247
262
248
263
// Cannot yet have inner class because of this error message:
You can’t perform that action at this time.
0 commit comments