some cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-07-14 21:12:14 +04:00
parent 0df4f139d8
commit 813226e6f3
3 changed files with 8 additions and 13 deletions

View File

@ -1180,24 +1180,27 @@ function getPrevLocation(){
/********************************************************* Workers ***/
// get/create a named worker queue...
//
function getWorkerQueue(name, no_auto_start){
// attach the the previous queue...
// create a new worker queue...
if(WORKERS[name] == null){
var queue = makeDeferredsQ()
WORKERS[name] = queue
// start if needed...
if(!no_auto_start){
queue.start()
}
// return existing worker queue...
} else {
var queue = WORKERS[name]
}
return queue
}
// kill all worker queues...
//
function killAllWorkers(){
for(var k in WORKERS){
console.log('Worker: Stopping:', k)

View File

@ -731,15 +731,6 @@ function updateImagesOrientationQ(gids, no_update_loaded){
.fail(function(){ queue.notify(gid, 'fail') })
})
// auto-stop the queue...
if(last != null){
// NOTE: this is mostly for reporting...
// XXX do we need to auto-stop this???
last.done(function(){
queue.resolve()
})
}
return queue
}

View File

@ -696,8 +696,9 @@ function makeDeferredsQ(first){
*/
// Report work state...
// XXX make this a propper state, or integrate into the deferred in
// XXX make this a proper state, or integrate into the deferred in
// a more natural way...
// ...need a way to bind to this state change...
queue.isWorking = function(){
if(queue.state() != 'resolved' && last.state() != 'resolved'){
return true