lib/ResourcePool.js
function ResourcePool (options) {
	this.max = options.max || 1;
	this.maxUses = options.maxUses || 1;
	this.create = options.create || function () {};
	this.destroy = options.destroy || function () {};
	this.active = 0;
	this.resources = new Array(this.max);
	this.resourceActive = new Array(this.max);
	this.resourceUses = new Array(this.max);
}
function ResourcePool (options) {
	this.max = options.max || 1;
	this.maxUses = options.maxUses || 1;
	this.create = options.create || function () {};
	this.destroy = options.destroy || function () {};
	this.active = 0;
	this.resources = new Array(this.max);
	this.resourceActive = new Array(this.max);
	this.resourceUses = new Array(this.max);
}
function ResourcePool ( options ) { this . max = options . max || 1 ; this . maxUses = options . maxUses || 1 ; this . create = options . create || function ( ) { } ; this . destroy = options . destroy || function ( ) { } ; this . active = 0 ; this . resources = new Array ( this . max ) ; this . resourceActive = new Array ( this . max ) ; this . resourceUses = new Array ( this . max ) ; }
Class for managing a pool of resources

@param {object} options
@param {int} options.max
Maximum number of resources to keep
@param {int} options.maxUses
Maximum number of times a resource may be used
@param {function} options.create
Called to create a new Resource
@param {function} options.destroy
Called to destroy an resource, after it is used up
-- @param {Resource}
Class for managing a pool of resources