helene
helene copied to clipboard
The server sent events mode might not fully work on multi instance clusters
Right now the init call (http) needs to occur on the same server as the event source connection is established at for some event event functionality to work.
Authentication actually works fine since we send the token in the HTTP request for the EventSoource:
https://github.com/leonardoventurini/helene/blob/3db53f62eb6c882f1da5c29c7e19bb4eda180a1e/packages/server/src/transports/http-transport.ts#L149
The problem is when we call sendEvent
to the connection instance coming from a method call:
https://github.com/leonardoventurini/helene/blob/e47b02a9e9d73ee9ebeb4a60aae905d5a2587ec0/packages/server/src/client-node.ts#L153
We need to leverage Redis pub/sub for this.
For now using the normal event functionality should work fine.