java.lang.Object | |
↳ | com.facebook.imagepipeline.producers.JobScheduler |
Manages jobs so that only one can be executed at a time and no more often than once in
mMinimumJobIntervalMs
milliseconds.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | JobScheduler.JobRunnable |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
JobScheduler(Executor executor, JobScheduler.JobRunnable jobRunnable, int minimumJobIntervalMs) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
clearJob()
Clears the currently set job.
| ||||||||||
synchronized long |
getQueuedTime()
Gets the queued time in milliseconds for the currently running job.
| ||||||||||
boolean |
scheduleJob()
Schedules the currently set job (if any).
| ||||||||||
boolean |
updateJob(EncodedImage encodedImage, int status)
Updates the job.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Clears the currently set job.
In case the currently set job has been scheduled but not started yet, the job won't be executed.
Gets the queued time in milliseconds for the currently running job.
The result is only valid if called from run(EncodedImage, int)
.
Schedules the currently set job (if any).
This method can be called multiple times. It is guaranteed that each job set will be executed no more than once. It is guaranteed that the last job set will be executed, unless the job was cleared first.
The job will be scheduled no sooner than minimumJobIntervalMs
milliseconds
since the last job started.
Updates the job.
This just updates the job, but it doesn't schedule it. In order to be executed, the job has to be scheduled after being set. In case there was a previous job scheduled that has not yet started, this new job will be executed instead.