mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-03 04:40:10 +00:00
added a generic getWorkerQueue(...)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3c9322a4fe
commit
0df4f139d8
@ -361,13 +361,7 @@ if(window.CEF_dumpJSON != null){
|
||||
window.makeImagesPreviewsQ = function(gids, sizes, mode){
|
||||
gids = gids == null ? getClosestGIDs() : gids
|
||||
|
||||
// attach the the previous queue...
|
||||
if(WORKERS.preview_generator == null){
|
||||
var queue = makeDeferredsQ()
|
||||
WORKERS.preview_generator = queue.start()
|
||||
} else {
|
||||
var queue = WORKERS.preview_generator
|
||||
}
|
||||
var queue = getWorkerQueue('preview_generator')
|
||||
|
||||
// attach the workers to the queue...
|
||||
$.each(gids, function(_, gid){
|
||||
|
||||
19
ui/data.js
19
ui/data.js
@ -1179,6 +1179,25 @@ function getPrevLocation(){
|
||||
|
||||
/********************************************************* Workers ***/
|
||||
|
||||
// get/create a named worker queue...
|
||||
//
|
||||
function getWorkerQueue(name, no_auto_start){
|
||||
// attach the the previous queue...
|
||||
if(WORKERS[name] == null){
|
||||
var queue = makeDeferredsQ()
|
||||
WORKERS[name] = queue
|
||||
if(!no_auto_start){
|
||||
queue.start()
|
||||
}
|
||||
} else {
|
||||
var queue = WORKERS[name]
|
||||
}
|
||||
return queue
|
||||
}
|
||||
|
||||
|
||||
// kill all worker queues...
|
||||
//
|
||||
function killAllWorkers(){
|
||||
for(var k in WORKERS){
|
||||
console.log('Worker: Stopping:', k)
|
||||
|
||||
10
ui/files.js
10
ui/files.js
@ -717,18 +717,10 @@ function updateImagesOrientation(gids, no_update_loaded){
|
||||
|
||||
// queued version of updateImagesOrientation(...)
|
||||
//
|
||||
// XXX do we need to auto-stop this???
|
||||
function updateImagesOrientationQ(gids, no_update_loaded){
|
||||
gids = gids == null ? getClosestGIDs() : gids
|
||||
|
||||
//var queue = makeDeferredsQ().start()
|
||||
// attach the the previous queue...
|
||||
if(WORKERS.image_orientation_reader == null){
|
||||
var queue = makeDeferredsQ()
|
||||
WORKERS.image_orientation_reader = queue.start()
|
||||
} else {
|
||||
var queue = WORKERS.image_orientation_reader
|
||||
}
|
||||
var queue = getWorkerQueue('image_orientation_reader')
|
||||
|
||||
var last = null
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user