Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chat #5

Open
3 of 9 tasks
irth opened this issue Feb 7, 2023 · 0 comments
Open
3 of 9 tasks

chat #5

irth opened this issue Feb 7, 2023 · 0 comments

Comments

@irth
Copy link
Owner

irth commented Feb 7, 2023

  • 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant