
export class XHRPool{
	constructor(){
		this.workers = [];
	}

	getWorker(){
		if (this.workers.length === 0){
			let worker = new XMLHttpRequest();
			this.workers.push(worker);
		}

		let worker = this.workers.pop();

		return worker;
	}

	returnWorker(worker){
		this.workers.push(worker);
	}
};

//Potree.workerPool = new Potree.WorkerPool();
