louischatriot/node-redis-pubsub

Is it possible to expire listeners?

Opened this issue · 0 comments

I want to use node-redis-pubsub in conjunction with websockets. Is it possible that the listeners expire after a defined period?

My usecase:
At the websocket server on each socket connection a unique token specified for that client will create some event listeners. These listeners listening on that token should be removed after a specified period.
Is it possible to add a expiration time? I don't want to have an increased amount of listeners stored for eternity, that never get executed, maybe due to a crash of my server instance.

This package is fairly new to me , but I know you can add an 'EX' (expiration time) to node-redis.

Thanks in advance!