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

Improve ws client - 1 #10

Merged
merged 3 commits into from
Jul 30, 2024
Merged

Improve ws client - 1 #10

merged 3 commits into from
Jul 30, 2024

Conversation

wuminzhe
Copy link
Owner

@wuminzhe wuminzhe commented Jul 30, 2024

According to @ioquatix's Design feedback for ws client.

  1. Use Sync for top level entry points.
  2. Use Message#parse
  3. Don't execute the block of start function in a child task

@wuminzhe wuminzhe merged commit 7d0e299 into main Jul 30, 2024
@wuminzhe wuminzhe deleted the improve-ws-client branch July 30, 2024 03:38
ScaleRb.logger.debug "Received message: #{data}"

Async do
task.async do
client.handle_response(data)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'd want to add error handling here - i.e. what happens if handle_response(data) fails?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I'll add error handling here

Copy link

@ioquatix ioquatix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a nice simplification, I think we just need to work on error handling now.

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.

2 participants