ext/curl/curl.js
function countdown (howMany, lambda, completed) {
		var result;
		return function () {
			if (--howMany >= 0 && lambda) result = lambda.apply(undef, arguments);
			// we want ==, not <=, since some callers expect call-once functionality
			if (howMany == 0 && completed) completed(result);
			return result;
		}
	}
function countdown (howMany, lambda, completed) {
		var result;
		return function () {
			if (--howMany >= 0 && lambda) result = lambda.apply(undef, arguments);
			// we want ==, not <=, since some callers expect call-once functionality
			if (howMany == 0 && completed) completed(result);
			return result;
		}
	}
function countdown ( howMany , lambda , completed ) { var result ; return function ( ) { if ( -- howMany >= 0 && lambda ) result = lambda . apply ( undef , arguments ) ; // we want ==, not <=, since some callers expect call-once functionality if ( howMany == 0 && completed ) completed ( result ) ; return result ; } }
Returns a function that when executed, executes a lambda function,
but only executes it the number of times stated by howMany.
When done executing, it executes the completed function. Each callback
function receives the same parameters that are supplied to the
returned function each time it executes.  In other words, they
are passed through.
@private
@param howMany {Number} must be greater than zero
@param lambda {Function} executed each time
@param completed {Function} only executes once when the counter
reaches zero
@returns {Function}
Returns a function that when executed executes a lambda function but only executes it the number of times stated by howMany . When done executing it executes the completed function . Each callback function receives the same parameters that are supplied to the returned function each time it executes . In other words they are passed through .