-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for RxJava 3 #6871
Comments
Can also see a dependency on RxAndroid v2 in v7, is this needed?
|
There's a release for rxandroid updated to RxJava3 |
Rxjava 2 support ends on February 28, 2021. This is becoming more pressing. |
An option is also https://github.com/akarnokd/RxJavaBridge#RxJavaBridge |
diff --git a/content/blog/2021-02-10.md b/content/blog/2021-02-10.md new file mode 100644 index 0000000..69aad22 --- /dev/null +++ b/content/blog/2021-02-10.md @@ -0,0 +1,39 @@ +--- +title: RxJava2からRxJava3に移行 +date: "2021-02-10T00:00:00.000Z" +--- + +というのを目論んでいたのだけど、[Realmが移行する気なかったりする](realm/realm-java#6871 +`import`の置換は特に造作もないけど、テストが結構失敗するようになってしまってその解決に時間がかかってしまった。結論としては何のことはなく、RxJava2をまだ何点か併用する必要があるので、Rxを同期実行させるTestRuleにもその旨両方記載する必要があったのでした。実装例としてはこんな感じ。 + +```kotlin +class ImmediateSchedulersRule: TestRule { + @OverRide + public fun apply(base: Statement, description: Description) { + return new Statement() { + @OverRide + public fun evaluate() { + // こっちはRxJava3 + RxJavaPlugins.setIoSchedulerHandler { Schedulers.trampoline() } + RxJavaPlugins.setComputationSchedulerHandler { Schedulers.trampoline() } + RxJavaPlugins.setNewThreadSchedulerHandler { Schedulers.trampoline() } + // RxJava2が生きてる場合はこちらも + io.reactivex.plugins.RxJavaPlugins.setIoSchedulerHandler { io.reactivex.schedulers.Schedulers.Schedulers.trampoline() } + io.reactivex.plugins.RxJavaPlugins.setComputationSchedulerHandler { io.reactivex.schedulers.Schedulers.Schedulers.trampoline() } + io.reactivex.plugins.RxJavaPlugins.setNewThreadSchedulerHandler { io.reactivex.schedulers.Schedulers.Schedulers.trampoline() } + try { + base.evaluate() + } finally { + RxJavaPlugins.reset() + // こちらも忘れずに + io.reactivex.plugins.RxJavaPlugins.reset() + } + } + } + } +} +``` + +### 結論 + +Realm早く辞めたい
Am I missing something or has this still not happened yet? |
Would be good to be updated on that topic @cmelchior. What is the plan about it ? |
Any updates on this issue @cmelchior? |
Describe your problem or use case
Please add support for RxJava 3 to Realm 7+
https://github.com/ReactiveX/RxJava
The text was updated successfully, but these errors were encountered: