-
Notifications
You must be signed in to change notification settings - Fork 0
chat #5
Copy link
Copy link
Open
Description
irth
opened on Feb 7, 2023
Issue body actions
- 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)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels