It would be nice to have a function to move a valid and existing request to fornt of the queue, Meaning, if there is an active download it would be paused (with queued status) and would be dowloaded normally after the one that had been pushed to top id finished.
@Mahan3340 Fetch downloads Request based on time created and the priority set. You can use the update request method to update the initial request. Does that not work well?
assume there is request-1 in the queue and is being downloaded (all with same priority), the user clicks another download to start (this request for this download might not exist yet, probably first time), so I will enqueue the new request but it has to wait for the earlier one to be completed, I can't use priority because there are infinite downloads and even after request-2 there might a request-3 come that has to be downloaded sooner and so on. what you say is that I enqueue and then immediately call update request, will that work ? will that update the time and pause the current download and starts this one ?
Another Question: if request-1 has priority HIGH and request-2 has just arrived with priority HIGH will request-1 go to state queued (paused?) and request-2 start?
Fetch currently works like this :
High -> earliest -> next -> next
Normal -> earliest -> next
Low -> earliest -> next -> next
All high priority will be downloaded first. Once there are no more high priority downloads, the normal ones are downloaded based on the earliest and then low queue is handled.
Mhm is see what you trying to do in terms of promoting a download. Let me brain storm and I will post back.
the policy works fine if the priorities are different, but when one request with high priority arrives It won't stop current request with also HIGH priority. it would be great if there was an option to enable this behavior. thanks for your time
Still looking into this.
@Mahan3340 new version of Fetch 3.0.2 with new method for changing the way the priorirty queue sorts by timestamp.
eg:
final FetchConfiguration fetchConfiguration = new FetchConfiguration.Builder(this)
.enableRetryOnNetworkGain(true)
.setDownloadConcurrentLimit(1)
.setPrioritySort(PrioritySort.DESC) //default is PrioritySort.ASC
.build();
Let me know if this works well.
@tonyofrancis Thank you so much I will try it and let you know
Most helpful comment
@Mahan3340 new version of Fetch 3.0.2 with new method for changing the way the priorirty queue sorts by timestamp.
eg:
Let me know if this works well.