Skip to content

Update WS server client to pass in topic context and connection#332

Merged
benjreinhart merged 4 commits intomainfrom
ws
Oct 4, 2024
Merged

Update WS server client to pass in topic context and connection#332
benjreinhart merged 4 commits intomainfrom
ws

Conversation

@benjreinhart
Copy link
Copy Markdown
Contributor

@benjreinhart benjreinhart commented Oct 4, 2024

Some improvements to ws client:

  1. Pass more context into handler. This allows us to access params (like sessionId) from the topic name (e.g., sessions:123). Previously we would also pass this value in the payload but that is redundant since we should be able to get it from the topic. We also pass in the event in case that is ever helpful.
  2. Pass in a "connection" to the handler. This allows us to "reply" to one connected client. We've been broadcasting messages to all clients. I'll be using this in some future work.
  3. Remove "outgoing" validating on the server as it's not really needed and was creating more noise for no gain.

@benjreinhart benjreinhart requested a review from versecafe October 4, 2024 22:31
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

Successfully merging this pull request may close these issues.

1 participant