-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
There was a problem hiding this 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.
There was a problem hiding this 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)
src/server/mod.rs
Outdated
); | ||
} | ||
if let Some(delta) = bc.subscribe_to_broadcasts(broadcast_subs, broadcasts) { | ||
for (k, v) in Broadcast::into_hashmap(delta).into_iter() { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/util/megaphone.rs
Outdated
@@ -86,12 +98,18 @@ impl From<Broadcast> for (String, String) { | |||
} | |||
} | |||
|
|||
impl From<Broadcast> for (String, BroadcastValue) { |
There was a problem hiding this comment.
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
d4e936a
to
ee7cb91
Compare
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. |
Closes #59