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

Use only one networking service for all chains #1398

Merged
merged 11 commits into from
Nov 24, 2023

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Nov 23, 2023

Close #111

This PR refactors the networking service so that it just has a single function: add_chain.
add_chain returns an Arc<NetworkingServiceChain> that can be used to interact with that chain. Once all the Arcs are dead, the chain is removed from the networking service.

The Client now has a single networking service that is initialized lazily.

I've had to introduce a small hack because start_services can't be made async before #735. For this reason, adding a chain is done by sending a sender to the background, rather than receiving a receiver, which would have been more clean.

@tomaka tomaka added this pull request to the merge queue Nov 24, 2023
Merged via the queue into smol-dot:main with commit 89fd7d8 Nov 24, 2023
22 checks passed
@tomaka tomaka deleted the network-service-one-chain branch November 24, 2023 07:39
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.

Use only one network service for all chains
1 participant