Skip to content

How ZLTaskManager determines what Task to do next

zackliston edited this page Dec 30, 2014 · 2 revisions

The ZLTaskManager looks at several values to determine which Task should be started next, when there is a thread available.

The first requirement is that the Task is ready. For example, it hasn't been started and exceeded it's retry count. This happens for tasks you start with an infinite retry count but have failed for the max session retries. They will be retried again later (either when you programmatically reset session retries or the app is restarted).

Secondly, only Task with requriesInternet flag set to NO will be started if the application does not have Internet.

Finally, out of the remaining tasks that fit the above criteria, the next one will be chosen based on these criteria:

1: Major Priority
2. Minor Priority
3. Retry Count (lowest retry count is executed first)
4. Time Created

Where 1 is most important and 4 is least important.

Clone this wiki locally