SHARE
TWEET

partial results

a guest May 29th, 2014 351 Never
  1. //using http://rxscala.github.io/  0.18.3
  2.     val five = Observable.interval(5000 millis).take(1)
  3.     val jdbc = Observable[String](subscriber => {
  4.       val rs = conn.prepareStatement("select name from persons").executeQuery()
  5.       while (rs.next() && !subscriber.isUnsubscribed) {
  6.         subscriber.onNext(rs.getString("name"))
  7.       }
  8.       subscriber.onCompleted()
  9.     })
  10.     val max = jdbc.takeUntil(five)
  11.     println(max.toBlockingObservable.toList)
RAW Paste Data
Top