Reputation: 5048
I "found" that socket.io can be configured to use different storages for client storage logic, for example the redis store ,
my question is, what operations affect the use of that storage?
for example do an operation like socket.set('data', takes advantages of that configured storage?
what other operations?
thanks
Upvotes: 1
Views: 206
Reputation: 547
The store is used to store all data that is related to a client connections. When a connection is closed a client store is destroyed after a expiration period.
As for your question related to socket.set the answer is: yes, it does.
For an example (taken from the socket.io website) see below:
var io = require('socket.io').listen(80);
io.sockets.on('connection', function (socket) {
socket.on('set nickname', function (name) {
socket.set('nickname', name, function () {
socket.emit('ready');
});
});
socket.on('msg', function () {
socket.get('nickname', function (err, name) {
console.log('Chat message by ', name);
});
});
});
Upvotes: 1