Initial problems in rxjava tutorial

on page 209, i think there is problem of PublishSubject initialize

val sourceObservable = PublishSubject<String>()  // correct : PublishSubject.create<String>()
sourceObservable.subscribe(buffer_1)


sourceObservable
  .buffer(bufferTimeSpan,TimeUnit.SECONDS, bufferMaxCount)
  .map { it.size }
  .subscribe(buffer_2)

Thanks for finding that @flatrocktech! We’ve added that to the Errata for the 1st edition. This will be fixed in the 2nd edition.

1 Like