Skip to content

Send message to all connected web socket clients fix #645#680

Merged
jknack merged 1 commit intomasterfrom
645
Mar 21, 2017
Merged

Send message to all connected web socket clients fix #645#680
jknack merged 1 commit intomasterfrom
645

Conversation

@jknack
Copy link
Copy Markdown
Member

@jknack jknack commented Mar 20, 2017

No description provided.

* @param err An err callback.
* @throws Exception If something goes wrong.
*/
void broadcast(final Object data, final SuccessCallback success, final OnError err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Final on interface method that are not default makes no sense since they do not affect the actual implementation.


@Override
public void broadcast(final Object data, final SuccessCallback success, final OnError err)
throws Exception {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The broadcast terminates on the first error. Wouldn't it be better to try to send to all endpoint, log the exception and throw a new one if there was at least one failure?

Copy link
Copy Markdown
Member

@krisztiankocsis krisztiankocsis left a comment

Choose a reason for hiding this comment

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

See my comments.

Copy link
Copy Markdown
Member

@krisztiankocsis krisztiankocsis left a comment

Choose a reason for hiding this comment

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

See my two recommendations.

@jknack
Copy link
Copy Markdown
Member Author

jknack commented Mar 21, 2017

@krisztiankocsis thank you, I update the pull with your comments. You're right about broadcast error, but I didn't rethrow anything. Instead, I used the error callback to notify about a possible error.

@jknack jknack merged commit 08c255a into master Mar 21, 2017
@jknack jknack deleted the 645 branch June 4, 2017 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants