These are chat archives for ReactiveX/RxJava

Aug 2018
Igor Bozin
Aug 24 2018 14:46

@akarnokd yes, something exactly like this, thank you. I am still not sure how to chain those asynchronous calls though, since i operate on the database.

                .subscribe(new Observer<RxObservableList<Uri>>() {
                    public void onSubscribe(Disposable d) {
                        Log.d(TAG, "ONSUBSCRIBE ");

                    public void onNext(RxObservableList<Uri> uris) {
                        String s = makePathString(uris.getList());
                        AppExecutor.getInstance().diskIO().execute(() -> viewModel.updatePicturePaths(s)); // <-- THis async call should be performed on every onNext 
                        Log.d(TAG, "ONNEXT");

                    public void onError(Throwable e) {
                        Log.d(TAG, "ONERROR  " + e);

                    public void onComplete() {
                        Log.d(TAG, "ONCOMPLETE  ");

How do I construct my Subscription so that before every onNext call I can perform a write operation on the database? I have tried doOnNext which is supposed to be executed before onNext, but it is always called from the main thread

David Stocking
Aug 24 2018 19:33
@ylecaillez woopsy I didn't notice your message. Yours appears to be really similar. The only difference appears to be that I take a action to run not just filter the first value. Yours kind of looks like it implements first().