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

feat: return broadcast errors for invalid broadcast id's #63

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

bbangert
Copy link
Member

Closes #59

jrconlin
jrconlin previously approved these changes Aug 28, 2018
Copy link
Member

@jrconlin jrconlin left a comment

Choose a reason for hiding this comment

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

I'm guessing you also ran this through rust fmt.

Copy link
Member

@pjenvey pjenvey left a comment

Choose a reason for hiding this comment

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

any reason why the internal subscribe/init methods don't return the missing broadcasts vs handling it in server? (granted it doesn't matter much)

);
}
if let Some(delta) = bc.subscribe_to_broadcasts(broadcast_subs, broadcasts) {
for (k, v) in Broadcast::into_hashmap(delta).into_iter() {
Copy link
Member

Choose a reason for hiding this comment

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

you can do response.extend(Broadcast::into_hashmap(delta)) here

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to do something like that, but extend wants references, and doing that provides ownership, so the types didn't match.

Copy link
Member Author

Choose a reason for hiding this comment

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

Odd, doing it that way works, I guess there's an Into that was satisfied.

@@ -86,12 +98,18 @@ impl From<Broadcast> for (String, String) {
}
}

impl From<Broadcast> for (String, BroadcastValue) {
Copy link
Member

Choose a reason for hiding this comment

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

the From for (String, String) above this is now no longer used, let's kill it

@bbangert
Copy link
Member Author

I was trying to avoid updating the API too much, and trying to keep concerns separate. ie, having megaphone handle it directly seemed to expose too much knowledge about the final output (JSON serialization). So the server API has knowledge of the final output seemed a better trade-off.

@bbangert bbangert merged commit 194df5e into master Aug 29, 2018
@bbangert bbangert deleted the feat/issue-59 branch August 29, 2018 16:23
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.

3 participants