-
-
Notifications
You must be signed in to change notification settings - Fork 116
Description
Is your feature request related to a problem? Please describe.
WebSockets are expensive. Browsers allow only a few of them per domain. If I want to split my stores up and synchronize them with my server running a createWsServer
then I have to have a separate WebSocket per store (I think).
Describe the solution you'd like
Expand createWsServer
and createWsSynchronizer
to multiplex the messaging for multiple stores. So instead of sending [clientId, message-for-store]
the messages would be framed as [clientId, storeId, message-for-store]
.
Describe alternatives you've considered
I considered putting all reactive state into a single store, but I don't love that option.
Additional context
I am building a dev server that runs locally and I can probably open more WebSockets than the normal web app might, without degrading performance, but I would rather not have 5 sockets open if I can avoid it.