I’m using ocpp-rpc package to run an OCPP server, currently I’m using Map to store the connected clients object, I want to reference them later.
I’m storing them like below
const connectedChargers = new Map();
server.on('client', async (client) => {
console.log(`${client.identity} connected!`);
connectedChargers.set(client.identity, client); // storing client reference
});
I want to know is this a best practice to do? Is there any better way to achieve this?
My system going to have thousands of clients that connecting to the server, so I need optimal way to handle this.
Also I tried to save them in the Redis, but it fails due to circular references.
Basically I need to know that my aproach is good or bad and if it is bad a better way to achieve this.
I tried to save them in the Redis, but it fails due to circular references. I want