3

Version 1.1.0 just came out and it looks like they dropped rx.observables.AbstractOnSubscribe

Removals from Public API

  • Observable.onBackpressureBlock
  • rx.observables.AbstractOnSubscribe
  • Removal of stateful methods from the generic rx.subjects.Subject abstract class

AbstractOnSubscribe was my preferred way of creating non-trivial observables. Why was it removed, and what's can I replace it with?

Malt
  • 28,965
  • 9
  • 65
  • 105

1 Answers1

3

AbstractOnSubscribe was marked as experimental thus always carried the chance of being removed.

The class has been replaced by SyncOnSubscribe which works roughly the same but with internals that have lower overhead; this required API changes (i.e., thinner API than the State object).

You can use the many factory methods to create your OnSubscribe instance or extend SyncOnSubscribe directly.

akarnokd
  • 69,132
  • 14
  • 157
  • 192
  • I find it odd that it was simply removed without being deprecated first. I realize it's experimental, but still. Why not keep both for a while? – Malt Dec 03 '15 at 23:00
  • Managed to find the relevant GitHub issue. If anyone's interested: https://github.com/ReactiveX/RxJava/pull/3118 – Malt Dec 03 '15 at 23:01
  • True, it should have been deprecated first but 1.0.17 and 1.1.0 came too close to each other. Besides, I'm happy Netflix is releasing again after so many weeks and piled up changes. – akarnokd Dec 03 '15 at 23:03
  • 1
    Experimental apis are not stable and may change in any release. Also if you need some time to transition between `AbstractOnSubscribe` and `SyncOnSubscribe` you can pin to 1.0.17. The only changes between that and 1.1.0 are the api changes. – Aaron Dec 05 '15 at 01:07