@luminati-io/luminati-proxy
Version:
A configurable local proxy for luminati.io
26 lines (23 loc) • 546 B
JavaScript
// LICENSE_CODE ZON ISC
; /*jslint node:true, esnext:true, evil: true*/
const cluster = require('cluster');
class Cache_report {
constructor(){
this.workers = {};
}
notify(id, space){
this.workers[id] = space;
this.cleanup();
}
cleanup(){
for (let id of Object.keys(this.workers))
{
if (!cluster.workers[id])
delete this.workers[id];
}
}
get(){
return Object.values(this.workers);
}
}
module.exports = Cache_report;