Closed erickcchoi closed 11 months ago
Hi, once the task is enqueued it is managed by the operating system (iOS or Android), which will control how many tasks are run in parallel. If you want more control over that experience (e.g. limiting the number of tasks that query the same host) then you should look into using a TaskQueue. For example, using the MemoryTaskQueue
you can limit the number of concurrent host connections, and that may solve your problem here. It's not perfect though, as the TaskQueue sits in front of the downloader and delays the actual enqueuing of the task, so if your app moves to a suspended state while the queue is not yet empty, those remaining tasks are not enqueued.
Other than that, there's really nothing I can do here, as this all depends on how Android manages background tasks.
Thank you for your quick replay, The "TaskQueue" solution work for me. Thank you.
Describe the bug Using "FileDownloader().enqueue()" to download 143 files. In low speed network will cause the program stall, even can't click the "+" button to increase the on screen counter. but the program work normally in full speed network.
To Reproduce Steps to reproduce the behavior:
Expected behavior Program running normally in any network speed.
Code
https://github.com/erickcchoi/bug_report