-
Notifications
You must be signed in to change notification settings - Fork 279
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
Investigate what happens when events sender is not configured #1896
Comments
As far as i can see It seems like event is just discarded if #[test]
fn produce_event_none_events_sender() {
let block = ValidBlock::new_dummy().commit();
let wsv = WorldStateView::<World>::default();
let event = wsv.create_time_event(&block).unwrap();
wsv.produce_event(event);
}
@mversic Could you please explain why it shouldn't compile. |
ok, I was confused by the return statement. It's all good here |
Maybe to avoid confusion we could refactor /// Send [`Event`]s to known subscribers.
fn produce_event(&self, event: impl Into<Event>) {
if let Some(events_sender) = &self.events_sender {
drop(events_sender.send(event.into()));
} else {
warn!("wsv does not equip an events sender");
}
} |
Yeah, if you wish |
…ation Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
…ation Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
…ation Signed-off-by: Shanin Roman <shanin1000@yandex.ru> Signed-off-by: BAStos525 <jungle.vas@yandex.ru>
This piece of code in
core/src/wsv.rs
should be investigated:I can't say why this compiles, maybe it
panics
inside the macro. Probably an error should be returned or events just droppedThe text was updated successfully, but these errors were encountered: