ReactiveX / RxAndroid

RxJava bindings for Android
Apache License 2.0
19.89k stars 2.95k forks source link

move from version 2 to version 3 #560

Closed ghost1372 closed 4 years ago

ghost1372 commented 4 years ago

Hello i want to use version 3 but i can't have the following code in version 3 Could you please guide me and write the same code in version 3?

io.reactivex.Observable.create(object : ObservableOnSubscribe<Int?>{
            override fun subscribe(e: ObservableEmitter<Int?>) {
                val ret = P7ZipApi.executeCommand(cmd)
                e.onNext(ret)
            }

        }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
            .subscribe(object : io.reactivex.functions.Consumer<Int?>{
                override fun accept(integer: Int?) {
                    try {
                            // codes
                        }
                    }
                    catch (e:Exception){}
                }
            })
akarnokd commented 4 years ago

https://github.com/ReactiveX/RxJava/wiki/What's-different-in-3.0

JakeWharton commented 4 years ago

Notably, I guess, the new package name is what you need to update.