How to update redis URL on fly
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Ambito
- backend, distributed-systems
Direzione di ricerca
No files or tests are named. Reproduce the shown server and client sequence with Redis on ports 6379 and 6378, then inspect how the adapter is replaced and how existing clients are tracked. Done should define a supported way to change the Redis URL without requiring clients to disconnect and reconnect.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello,
How can I update redis URL on fly ?
I use:
node 10.16.0
express 4.17.1
socket.io 2.3.0
socket.io-redis 5.2.0
socket.io-client 2.3.0
I try to replace with a new Adaptater and set it to socket server:
Server
var app = require('express')();
var http = require('http').createServer(app);
var io = require('socket.io')(http);
var redisAdapter = require('socket.io-redis');
//the old adaptater.
io.adapter(redisAdapter({ host: 'localhost', port: 6379 }));
http.listen(3000, () => {
console.log('listening on *:3000');
setInterval(() =>{
io.emit('bar')
}, 1000)
setTimeout(() => {
//the REDIS URL is updated, so I must update the Adaptater with the new URL of REDIS.
io.adapter(redisAdapter({ host: 'localhost', port: 6378 }));
}, 10000)
})
The redis instances in port 6378 and 6379 work.
My issue: after updated the REDIS URL, the clients socket.io (socket.io-client) don't receive the event bar (and any other events !)
Before to update the REDIS URL the clients had received the event bar.
Client
var io = require('socket.io-client')
var socket = io.connect('http://localhost:3000')
socket.on('bar', () => console.log('receive'))
After the update of REDIS URL, to receive this event, the clients socket.io must to disconnect and reconnect. (it's bad!)
- Lingua principale
- TypeScript
- Stelle
- 2.8k
- Fork
- 485
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di socketio/socket.io-redis-adapter
-
question
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
socketio/socket.io-redis-adapter#574 · 1 commento ·
-
io.fetchSockets() fails with createSentinelForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
socketio/socket.io-redis-adapter#573 · 1 commento ·
-
`hasBinary()` throws `RangeError: Maximum call stack size exceeded` on Mongoose documents, silently dropping events in sharded modeForse già presa @junsj119 l’ha presa 96 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
socketio/socket.io-redis-adapter#561 · 1 commento ·
Tutte le issue di socketio/socket.io-redis-adapter
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
outline/outline#14529 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
g1331/phantom-circuit#93 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
compiler
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
HerringtonDarkholme/hd-lang#1699 ·
I maintainer di solito rispondono entro 1 giorno