From 813226e6f3b4b818619259b1966cd1a174b88521 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 14 Jul 2013 21:12:14 +0400 Subject: [PATCH] some cleanup... Signed-off-by: Alex A. Naanou --- ui/data.js | 9 ++++++--- ui/files.js | 9 --------- ui/lib/jli.js | 3 ++- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ui/data.js b/ui/data.js index 5176c180..2a746fda 100755 --- a/ui/data.js +++ b/ui/data.js @@ -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) diff --git a/ui/files.js b/ui/files.js index 167fd5ee..e47454cf 100755 --- a/ui/files.js +++ b/ui/files.js @@ -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 } diff --git a/ui/lib/jli.js b/ui/lib/jli.js index d0176dae..329985f7 100755 --- a/ui/lib/jli.js +++ b/ui/lib/jli.js @@ -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