socketio / socket.io-redis-emitter

The Socket.IO Redis emitter, allowing to communicate with a group of Socket.IO servers from another Node.js process.
https://socket.io/docs/v4/redis-adapter/
MIT License
722 stars 121 forks source link

Cannot send callbacks when emitting to single socket #50

Closed ismail-khan closed 7 years ago

ismail-khan commented 7 years ago

Running Heroku with multiple dynos, and using socket.io-emitter with socket.io-redis.

So far, I am able to emit events to specific connected clients using emitter.to(socketId).emit(...).

However, I'm trying to do emitter.to(socketId).emit('event', function(){...}), but the callback function is never sent to the client. Any other type of argument is successfully sent, but callback functions show up as undefined.

Is this by design? If so, is there any chance of this being introduced in a future update? I'm relying on callbacks quite a bit and am trying to avoid abandoning them.

darrachequesne commented 7 years ago

As far as I know, acknowledgements are not supported when broadcasting, so I'm afraid you'll have to build your own system for that.

ismail-khan commented 7 years ago

Seems like it's a deliberate limitation of functionality. Would be really nice to have it, but oh well...