-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
difficulty:moderategetting-startedIssues that can be tackled if you don't know the internals of libp2p very wellIssues that can be tackled if you don't know the internals of libp2p very wellhelp wanted
Description
Description
I/O should not happen in the NetworkBehaviour
implementation. It should happen in the ConnectionHandler
implementation.
Motivation
All NetworkBehaviour
implementations are driven by a single future task. Opposite to that we spawn a new future task for every connection. Doing as much as possible, especially I/O, on the connection tasks and not on the main task allows logic to potentially run in parallel.
Current Implementation
Today libp2p-identify
drives the future returning a response to a remote in the NetworkBehaviour::poll
implementation.
rust-libp2p/protocols/identify/src/identify.rs
Lines 53 to 54 in 66c2755
/// Pending replies to send. | |
pending_replies: VecDeque<Reply>, |
Are you planning to do it yourself in a pull request?
No
Metadata
Metadata
Assignees
Labels
difficulty:moderategetting-startedIssues that can be tackled if you don't know the internals of libp2p very wellIssues that can be tackled if you don't know the internals of libp2p very wellhelp wanted