sproutcore/sproutcore — pull request #1218 by publickeating (2014-05-01 05:48:38+00:00)
Title: Adds SC.Task framework

See #874 for reference.

What I've done here is bring the framework up to the top-level (still optional and not included by default) and made some minor backwards compatible changes so that developers should be able to bring in the new framework and still have their SC.Tasks work the same as before. Likewise, they should be able to create new SC.Tasks* and add them to the background task queue just like before, but have them run like a new SC.Task* can be run (with different state callbacks and in groups).

What I (or hopefully someone else) will need to figure out before this comes in:

* Can we integrate the idle functionality of SC.TaskQueue to actively suspend tasks when the user is busy? i.e. if the user is idle and we start a long running task, can we get SC.TaskQueue to call suspend on its tasks when the user is busy again?
* Can we add task groups to the queue?