Skip to content

Instantly share code, notes, and snippets.

@andykent
Created July 8, 2010 13:31
Show Gist options
  • Save andykent/468000 to your computer and use it in GitHub Desktop.
Save andykent/468000 to your computer and use it in GitHub Desktop.
reservePort = function(callback) {
var tickCheck = function() {
if(AVAILABLE_PORTS.length > 0) {
callback(AVAILABLE_PORTS.shift())
} else {
process.nextTick(tickCheck)
}
}
tickCheck();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment