You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue when adding jobs from widgets like recycler view on bind view i need to know if job for that view is already added. This is an issue due to the fact that anytime you scroll down the list it will add job from item again and again and call onCanceled in job.
Does the library keep a reference to jobs in queue somewhere and how can i implement this if possible?
This is needed to avoid adding same jobs again and again and restarting or canceling job in progress that way.
The text was updated successfully, but these errors were encountered:
Creating a job from RV's onBind may not be a great idea (because it will happen a lot) but you can use singleInstanceBy parameter in the Job so that JobManager will keep only 1 instance of the job at a given time. Make sure you use addJobInBackground while adding the job.
Yes i am creating and adding jobs just as how you suggested. So there is no way to retrieve list of jobs from the library so that i can compare if they are already added?
There is a getJobStatus API but you cannot call it on the main thread because it will possibly wait for a lock on queues depending on JobManager's state.
FYI, It cannot distinguish between a Job that has never been added and a job that has finished.
Hi,
First thanks for this great library! :)
I have an issue when adding jobs from widgets like recycler view on bind view i need to know if job for that view is already added. This is an issue due to the fact that anytime you scroll down the list it will add job from item again and again and call onCanceled in job.
Does the library keep a reference to jobs in queue somewhere and how can i implement this if possible?
This is needed to avoid adding same jobs again and again and restarting or canceling job in progress that way.
The text was updated successfully, but these errors were encountered: