Skip to content

chat #5

@irth

Description

@irth
  • 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions