File tree Expand file tree Collapse file tree 3 files changed +5
-39
lines changed
language-adaptors/rxjava-scala/src
examples/scala/rx/lang/scala/examples Expand file tree Collapse file tree 3 files changed +5
-39
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ import scala.concurrent.duration._
22
22
import org .junit .{Before , Test , Ignore }
23
23
import org .junit .Assert ._
24
24
import rx .lang .scala .concurrency .Schedulers
25
- import rx .lang .scala .util .Timestamped
26
25
import java .io .IOException
27
26
28
27
@ Ignore // Since this doesn't do automatic testing, don't increase build time unnecessarily
@@ -379,7 +378,7 @@ class RxScalaDemo extends JUnitSuite {
379
378
380
379
@ Test def timestampExample () {
381
380
val timestamped = Observable .interval(100 millis).take(3 ).timestamp.toBlockingObservable
382
- for (Timestamped (millis, value) <- timestamped if value > 0 ) {
381
+ for ((millis, value) <- timestamped if value > 0 ) {
383
382
println(value + " at t = " + millis)
384
383
}
385
384
}
Original file line number Diff line number Diff line change @@ -246,14 +246,15 @@ class Observable[+T] private[scala] (val asJava: rx.Observable[_ <: T])
246
246
}
247
247
248
248
/**
249
- * Wraps each item emitted by a source Observable in a [[ rx.lang.scala.util.Timestamped ]] object .
249
+ * Wraps each item emitted by a source Observable in a timestamped tuple .
250
250
*
251
251
* <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/timestamp.png">
252
252
*
253
253
* @return an Observable that emits timestamped items from the source Observable
254
254
*/
255
- def timestamp : Observable [Timestamped [T ]] = {
256
- Observable [rx.util.Timestamped [_ <: T ]](asJava.timestamp()).map(Timestamped (_))
255
+ def timestamp : Observable [(Long , T )] = {
256
+ Observable [rx.util.Timestamped [_ <: T ]](asJava.timestamp())
257
+ .map((t : rx.util.Timestamped [_ <: T ]) => (t.getTimestampMillis, t.getValue()))
257
258
}
258
259
259
260
/**
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments