android-priority-jobqueue icon indicating copy to clipboard operation
android-priority-jobqueue copied to clipboard

Extra Params for Network quality

Open spirosoik opened this issue 9 years ago • 5 comments

setup params like requireNetwork(Network.Quality.GOOD). Imagine that you are trying to upload an image as external job and you receive because of bad network multiple timeouts even with retry strategy this will keep failing, so it will super nice if we have also a param which will setup the quality of the network.

spirosoik avatar Aug 03 '16 13:08 spirosoik

Seems like a "one off" feature request because most apps don't have a way to measure this. How are you measuring the quality ? How do you understand it recovers?

Mobile networks are fragile by design so it would be better to rely on back-off instead of an additional property.

yigit avatar Aug 03 '16 15:08 yigit

It's not a "one-off", you are right that they are fragile but what you can easily do is to check the type of the network. if you based on ConnectivityManager.TYPE_MOBILE then we can decide for example the type. Not sure if this based on the type of the antenna but I think it's based on how the symbol icon is shown in a device 4g, 3g, 2g, gprs which means the speed of the network.

about back-off this is what we have right now but imagine that you are in a place where the network is really bad by default.

spirosoik avatar Aug 03 '16 16:08 spirosoik

Actually, there are many times where you can get better speed from a 3g network then a 4g network due to congestion etc. so that information is not super solid (but helpful).

You can still provide your custom NetworkUtil but all you'll get is 3 levels. (UNMEASURED, MEASURED, DISCONNECTED). This might be enough.

For the future, I have some plans to allow custom constraints on jobs so once I have it, this might be implemented on top of it but I don't think it is prominent enough to become part of the API.

yigit avatar Aug 04 '16 01:08 yigit

So @yigit what you suggest about the case when a job starts Run and suddenly the network is down but you haven't an indicator of an exception in your task you are executing in the Job. Job is going to finish successfully but the task is not done. How can I mark my Job as not done based on the status of the task which I am executing there?

spirosoik avatar Sep 25 '16 11:09 spirosoik

@spirosoik did you find a solution?

mattvb91 avatar Nov 05 '17 21:11 mattvb91