socket.io-redis-streams-adapter icon indicating copy to clipboard operation
socket.io-redis-streams-adapter copied to clipboard

Not working with socket.io-redis-emitter

Open dzeroone opened this issue 2 years ago • 4 comments

I have tried to emit from a cronjob, but it's not reaching the client!

dzeroone avatar Nov 24 '23 13:11 dzeroone

Yes, the Redis emitter is meant to be used with the classic Redis adapter, we will have to implement a custom emitter publishing to the Redis streams.

darrachequesne avatar Nov 27 '23 07:11 darrachequesne

Yes, the Redis emitter is meant to be used with the classic Redis adapter, we will have to implement a custom emitter publishing to the Redis streams.

Is this something that is planned?

fjeldstad avatar Sep 02 '24 09:09 fjeldstad

Are there any significant drawbacks of just creating a dummy socket.io server with the redis-streams-adapter configured and using emit on that server instance to send events from background processes (like the cron job mentioned in the original post)?

I've tested this locally both with the old redis-adapter and this redis-streams-adapter and as far as I can see it works well; no need to call listen(...) or anything, just create a server instance and emit 🤷 Seems too good to be true! Is it?

fjeldstad avatar Sep 03 '24 10:09 fjeldstad

Hi @darrachequesne, is there any alternative to use the adapter/emitter pattern with this stream library? I would like to be able to have connection status retrieval and also a emitter for other micro-services (or event sources).

gmarcos87 avatar Apr 28 '25 07:04 gmarcos87