You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue
When trying to initialize the Emitter with an {host, port} object and the key option, I noticed nothing was published as expected on Redis, by running the Redis monitor: the key used remains the same as the default one socket.io :
To conclude with:
Basically , I cannot config a custom key, as the opts object is overriden. I suppose this is not how it's supposed to work, right?
Workaround
To be able to get it working as expected, I had to do as follows:
letredisOptions: SocketIORedisOptions={
host,
port,};// Unable to set key prop in previous object as TypeScript // would throw an error saying 'key' does not exist in SocketIORedisOptions type redisOptions["key"]="some-socket.io-key";constio=ioEmitter(redisOptions);
The text was updated successfully, but these errors were encountered:
Issue
When trying to initialize the Emitter with an
{host, port}
object and thekey
option, I noticed nothing was published as expected on Redis, by running the Redis monitor: thekey
used remains the same as the default onesocket.io
:1615484908.414247 [0 127.0.0.1:58230] "publish" "socket.io#/waiting_lines#" "\x93\xa7emitter\x83\xa4type\x02\xa4data\x92\xa4list\x84\xa4data\x94\x8d\xa2id\xd9$1eb84855-3081-4067-90a5-6bb2cb5e20d6\xaacreated_at\xb82020-09-23T11:44:08.000Z\xaaupdated_at\xb82021-01-29T06:33:42.000Z
I have the following packages:
"socket.io": "^2.3.0", "socket.io-emitter": "^3.2.0", "socket.io-redis": "^5.4.0",
I initialized the Emitter, as follows:
What I've noticed in
socket.io-emitter/index.js
file, in theinit
function (adding some console.log for debug purposes):Here's what the console shown:
[SOCKET.IO-EMITTER] Options: { key: 'some-socket.io-key' }
[SOCKET.IO-EMITTER] Options (2): { key: 'some-socket.io-key' }
[SOCKET.IO-EMITTER] Options (3): { host: '127.0.0.1', port: 6379 }
[SOCKET.IO-EMITTER] Prefix used: socket.io
To conclude with:
Basically , I cannot config a custom key, as the opts object is overriden. I suppose this is not how it's supposed to work, right?
Workaround
To be able to get it working as expected, I had to do as follows:
The text was updated successfully, but these errors were encountered: