mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-23 21:55:57 +03:00
Add backpressure buffer for downloads
This commit is contained in:
parent
fad7b75b96
commit
0e87dc995a
1 changed files with 1 additions and 0 deletions
|
@ -78,6 +78,7 @@ public class DownloadManager {
|
||||||
downloadsSubscription = downloadsQueueSubject
|
downloadsSubscription = downloadsQueueSubject
|
||||||
.flatMap(Observable::from)
|
.flatMap(Observable::from)
|
||||||
.lift(new DynamicConcurrentMergeOperator<>(this::downloadChapter, threadsSubject))
|
.lift(new DynamicConcurrentMergeOperator<>(this::downloadChapter, threadsSubject))
|
||||||
|
.onBackpressureBuffer()
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.map(download -> areAllDownloadsFinished())
|
.map(download -> areAllDownloadsFinished())
|
||||||
.subscribe(finished -> {
|
.subscribe(finished -> {
|
||||||
|
|
Loading…
Reference in a new issue