You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a way to broadcast messages to other websocket handler goroutines
backend commands to send messages
react component to provide the chat state using the websocket
nickname set command on ws api
hook the input to send a message (with a random nickname for now)
hook the data up to the existing chat component
handle reconnections
history?
simplest way - messages could have unique IDs, the server could store the messages and expose them over HTTP, so the client could just resync if the connection fails, skipping the messages they already received.
how to handle locking here? i guess we could do an RWLock, most of the time clients would read, and we would batch the history updates that require a lock in a goroutine so that we don't have to get a write lock every time someone sends a message. Can we ensure priority for the write lock? So that it can update the history periodically no matter how many clients try to read it.
set nickname (also ensure it's unique)
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: