Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@montekki
Copy link
Contributor

@montekki montekki commented Sep 28, 2020

Closes #1708

@montekki montekki added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Sep 28, 2020
) {
// Ignore the errors since these will be removed later.
for listener in listeners.iter_mut() {
let _ = listener.send(statement.clone()).await;
Copy link
Contributor

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?

Copy link
Contributor

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(),
Copy link
Contributor

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?

@pepyakin
Copy link
Contributor

bot merge

@ghost
Copy link

ghost commented Sep 28, 2020

Trying merge.

@ghost ghost merged commit db64485 into paritytech:master Sep 28, 2020
ordian pushed a commit that referenced this pull request Sep 28, 2020
* master:
  Add the XCM primitives crate. (#1760)
  Register listeners in statement distribution (#1759)
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support registering listeners in the statement distribution subsystem

3 participants