goch
goch copied to clipboard
Allow connecting to more than one chat simultaneously
Currently you can have only one chat per websocket connection.
This is limited in internal/agent/agent.go where Agent struct holds single Chat.
On client, this currently works by connecting to new chat and disconnecting from previous one each time a different chat is clicked. But this prevents getting messages from other chats, although you can still show number of unread messages by invoking the unread count endpoint.
https://nats-io.github.io/docs/developer/concepts/seq_num.html
At the bottom it mentions a nice pattern. So you can have many chats this way with the one connection i think.