-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Register listeners in statement distribution #1759
Register listeners in statement distribution #1759
Conversation
| ) { | ||
| // Ignore the errors since these will be removed later. | ||
| for listener in listeners.iter_mut() { | ||
| let _ = listener.send(statement.clone()).await; |
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.
a DQ: shouldn't we fan out sending and await the joined future?
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.
Something like futures::stream::iter(listeners.iter_mut()).for_each_concurrent(None, |listener| listener.send(statement.clone()) is probably a good idea. Then again, I have the impression that we're rarely going to have more than a few listeners at a time, so it may not make any practical difference.
| StatementDistributionMessage::Share(relay_parent, statement) => | ||
| StatementDistributionMessage::Share(relay_parent, statement) => { | ||
| inform_statement_listeners( | ||
| statement.clone(), |
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.
If it's cloned inside the function should we pass statement there as a reference to save us one clone?
|
bot merge |
|
Trying merge. |
Closes #1708