There are times where a bunch of data work has to be done, such processing the full history of tweets, checkins, or any of the larger connector datasets. Often this is when a new collection is being introduced, such as I'm facing in trying to get the Timeline one ready, and when it first turns on it needs to go back and index a *lot* of data, but it doesn't have to do it all at once or immediately necessarily either.
So, I've been thinking that it might be time for a mechanism to let services do this kind of "background" work. The simplest thing I can think of would be to have two new events from core, work://me/#stop and #start, that can be dynamically listened to when there's background work needing to be done. The service can't start work until the #start event, and must stop upon receiving a #stop and wait again until a #start.
Core could for now very rudimentarily just use os.loadavg() and a configure'd threshold to generate the events, that way the background work would always quiet itself on any system that was busy.
I'd really like to get the new timeline collection merged in soon and am kinda blocking on resolving this (or alternatively forcing all existing lockers through some up-front headaches to update), so any/all thoughts are welcome, and barring any blockers I'll try implementing it in the next day or two :)
Thanks!
Jer