lib/beanstalk_client.js
function() {
		if(!_self.waitingForResponse && _self.queue.length) {
			_self.waitingForResponse = true;
			var cmd = _self.queue.shift();

			if(_self.conn) {
				_self.conn.removeAllListeners('data');
				_self.conn.addListener('data', function(data) {
					Debug.log('response:');
					Debug.log(data);
					cmd.responseHandler.call(cmd, data);
				});
			}
			Debug.log('request:');
			Debug.log(cmd.command());
			process.nextTick(function() {
				_self.conn.write(cmd.command());
			});
		}
	}
function() {
		if(!_self.waitingForResponse && _self.queue.length) {
			_self.waitingForResponse = true;
			var cmd = _self.queue.shift();

			if(_self.conn) {
				_self.conn.removeAllListeners('data');
				_self.conn.addListener('data', function(data) {
					Debug.log('response:');
					Debug.log(data);
					cmd.responseHandler.call(cmd, data);
				});
			}
			Debug.log('request:');
			Debug.log(cmd.command());
			process.nextTick(function() {
				_self.conn.write(cmd.command());
			});
		}
	}
function ( ) { if ( ! _self . waitingForResponse && _self . queue . length ) { _self . waitingForResponse = true ; var cmd = _self . queue . shift ( ) ; if ( _self . conn ) { _self . conn . removeAllListeners ( 'data' ) ; _self . conn . addListener ( 'data' , function ( data ) { Debug . log ( 'response:' ) ; Debug . log ( data ) ; cmd . responseHandler . call ( cmd , data ) ; } ) ; } Debug . log ( 'request:' ) ; Debug . log ( cmd . command ( ) ) ; process . nextTick ( function ( ) { _self . conn . write ( cmd . command ( ) ) ; } ) ; } }
pushes commands to the server
pushes commands to the server