I have two observables: first is from library RxAndroidBle:
Observable<RxBleConnection> bluetoothObservable = RxBleClient.create(getBaseContext()).getBleDevice(macAddress)
.establishConnection(false)
Which connects to device and keeps connection while it has subscribers, and another
Observable<Response> serverObservable = Observable.fromCallable(() -> callServer())
Then I zip them together
bluetoothObservable.zipWith(serverObservable , (rxBleConnection, s) -> {
Log.d(TAG, "zip done");
return "mock result";
}).subscribe((s) -> {},
Throwable::printStackTrace);
But after zip bluetoothObservable
gets unsubscribed and connection immediately falls. What should I do to zip those observables and keep bluetoothObservable
alive/subscribed?