0.0.6 • Published 12 years ago

lockmethod v0.0.6

Weekly downloads
2
License
-
Repository
github
Last release
12 years ago

lock method for node.js

var lockMethod  =  require('lockMethod');

	var time = 3000;	

	var obj = { changeState  :  lockMethod(
		function(state,cb){
			setTimeout(function(){
				cb(state+time)		
			},time)	
			time -= 300;
		}
	)
	}

	obj.changeState('a',function(r){console.log(r);});
	obj.changeState('b',function(r){console.log(r);});
	obj.changeState('c',function(r){console.log(r);});

	result is >>>  

		a2700
		b2400
		c2100
		

	IF:	

	var obj = { changeState  :  
		function(state,cb){
			setTimeout(function(){
				cb(state+time)		
			},time)	
			time -= 300;
		}
	}

	Then result is >>>

		c2100
		b2100
		a2100
0.0.6

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago