0

So, I have implemented priority-job-queue which is perfectly documented and meets all my requirements. I have some difficulties though. As per client's request, I had to divide networks call into two parts, offline (queued server calls with priority-job-queue) and run-time (instant server calls). To cut short, what I'm trying to accomplish is to execute all queued server-calls before instant-run call (which is independent of priority-job-queue) being executed. Is there any way to handle this case. I would appreciate any help.

NOTE: I know a method called JobManager.count(), but after reading this post (https://github.com/yigit/android-priority-jobqueue/issues/193), I got confused a little bit if it really returns count of pending jobs or not?

Farid
  • 2,317
  • 1
  • 20
  • 34

1 Answers1

1

Why not just give those instant calls a higher priority and run them using priority-job-queue as well?

yigit
  • 37,683
  • 13
  • 72
  • 58
  • I believe I'll go with that. And I got stuck again. So what I want is to put failed server-request to `shouldReRunOnThrowable()` block and `stop()` JobManager there. So failed request will be fired when JobManager `start()`s. Well, I see structure feels cumbersome. But, we really need it. P.S. what happens if I `stop()` JobManager inside `shouldReRunOnThrowable` block and then `return RetryConstraint.RET RY`. Will this call be still retried when JobManager `start()`s. Because in normal case, any job after `stop()` not added to queue until JobManager `start()`s. – Farid Jul 01 '17 at 16:10