-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Removes the purge thread in favour of standard ScheduledThreadPoolExecutor APIs #7293
Conversation
…utor APIs The RXSchedulerPurge thread is currently enabled by default and runs every second to call purge() on each executor in the pool. This is causing significant issues for low powered devices (e.g. mobile phones), because it needs to periodically wake up the CPU to perform purging. The RXSchedulerPurge thread could be completely removed in favor of using the standard setRemoveOnCancelPolicy() API on the ScheduledThreadPoolExecutor which became available in Java 7 and offers removal of cancelled tasks at the moment they are cancelled in O(1).
The question is, how does this affect compatibility and desugaring? /cc @JakeWharton |
I do not recall the minimum Android version we decided on for 3.x. It doesn't seem explicitly documented anywhere. The API in question ( It's not unheard of for libraries to bump their minimum-supported Android API level in minor releases. So I'm supportive for the next minor version provided that the minimum is also documented somewhere. |
Okay then, from 3.0.14, we require API 21. I'll add this to the readme. |
Codecov Report
@@ Coverage Diff @@
## 3.x #7293 +/- ##
============================================
+ Coverage 99.53% 99.54% +0.01%
+ Complexity 6756 6744 -12
============================================
Files 747 747
Lines 47391 47347 -44
Branches 6382 6376 -6
============================================
- Hits 47170 47133 -37
+ Misses 103 96 -7
Partials 118 118
Continue to review full report at Codecov.
|
Sorry by minor I meant for a 3.1.0 rather than patch release in the 3.0.x series. At least then someone might look a bit more closely at the changes than a patch release where they expect only fixes and not new functionality / changes. Ultimately you can decide though since it's not explicitly documented anywhere and this is really about making it explicit. |
Indeed 3.1.0 would be more appropriate. |
The RXSchedulerPurge thread is currently enabled by default and runs every second
to call purge() on each executor in the pool. This is causing significant issues
for battery powered devices (e.g. mobile phones), because it needs to periodically
wake up the CPU to perform purging. The RXSchedulerPurge thread could be completely
removed in favour of using the standard setRemoveOnCancelPolicy() API on the
ScheduledThreadPoolExecutor which became available in Java 7 and offers removal
of cancelled tasks at the moment they are cancelled in O(1).