These are chat archives for ReactiveX/RxJava

22nd
Feb 2017
David Karnok
@akarnokd
Feb 22 2017 11:26
@pakoito What you experienced sounds like a resource management issue. In 2.x, the Disposable.dispose is not called from downstream on an onComplete() unlike in 1.x where the SafeSubscriber always calls unsubscribe. The standard way of dealing with resources along a stream is using() and performing final action via doFinally.
Vojtech Polivka
@vojtapol
Feb 22 2017 14:18
hi guys

I need to convert some callbacks to ReactiveX elements (Observable, Completable, Subject), but I am not sure what to pick. The problem is that the callback provides no value so it should be Completable but it is triggered multiple times so it should be Observable. What to choose? the normal use is this:

socket.on("connect", args -> doSomething())

where I know that args are always empty array.

Vojtech Polivka
@vojtapol
Feb 22 2017 14:26
would making Observable<java.lang.Void> be a good idea in this case?
David Karnok
@akarnokd
Feb 22 2017 19:31
A version-safe would be Observable<Object> and you ignore the value in the processing.
Vojtech Polivka
@vojtapol
Feb 22 2017 19:56
what do you mean by version-safe?
David Karnok
@akarnokd
Feb 22 2017 19:59
Void requires null values which are forbidden in 2.x; you'd save a lot of headache with Object such as (Integer)1
Vojtech Polivka
@vojtapol
Feb 22 2017 20:00
oh.. snap!

so that's really the best way to deal with this?

thats too bad.. I think there should be another top-level class (such as Subject, Completable) that would solve this more elegantly