mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-11-04 05:10:07 +00:00 
			
		
		
		
	some cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									0df4f139d8
								
							
						
					
					
						commit
						813226e6f3
					
				@ -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)
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user