-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add ProtocolsHandler trait #573
Conversation
a3a13dd
to
bd69c01
Compare
279bfde
to
d77f092
Compare
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.
I guess it is just me but I still consider on
, rather than inject
, to be the more appropriate prefix for those handler methods.
negotiating_in: Vec::new(), | ||
negotiating_out: Vec::new(), | ||
in_timeout: Duration::from_secs(10), | ||
out_timeout: Duration::from_secs(10), |
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.
We should make those configurable.
d1c9bcf
to
e09cef0
Compare
…ref-debug-impl * upstream/master: Add ProtocolsHandler trait (libp2p#573)
…_swarm * upstream/master: Add a PeriodicIdentification protocol handler (libp2p#579) Add ProtocolsHandler trait (libp2p#573)
…e-handled_node_tasks * upstream/master: Add a IdentifyTransport (libp2p#569) Tests for HandledNode (libp2p#546) Some minor fixes reported by clippy (libp2p#600) Add a PeriodicIdentification protocol handler (libp2p#579) Add ProtocolsHandler trait (libp2p#573) Use paritytech/rust-secp256k1 (libp2p#598) Use websocket 0.21.0 (libp2p#597) Reexport multihash from the facade (libp2p#587) Add substrate to the list of projects using libp2p (libp2p#595) Remove spaces before semicolons (libp2p#591)
…lection_stream * upstream/master: Use vecdeque for fair polling (libp2p#610) Add back the Swarm (libp2p#613) Remove dependency on tokio_current_thread (libp2p#606) Use chashmap from crates (libp2p#615) Fix grammar in core/nodes etc. (libp2p#608) Inject event by value in ProtocolsHandler (libp2p#605) Add a PeriodicPingHandler and a PingListenHandler (libp2p#574) Fix stack overflow when printing a SubstreamRef (libp2p#599) Add a peer id generator (libp2p#583) eg. -> e.g.; ie. -> i.e. via repren (libp2p#592) Add a IdentifyTransport (libp2p#569) Tests for HandledNode (libp2p#546) Some minor fixes reported by clippy (libp2p#600) Add a PeriodicIdentification protocol handler (libp2p#579) Add ProtocolsHandler trait (libp2p#573) Use paritytech/rust-secp256k1 (libp2p#598) Use websocket 0.21.0 (libp2p#597) Reexport multihash from the facade (libp2p#587) Add substrate to the list of projects using libp2p (libp2p#595) Remove spaces before semicolons (libp2p#591)
An implementation of
ProtocolsHandler
can be combined with other implementations into oneProtocolsHandler
that supports all the protocols together.This makes it possible to better isolate code in multiple modules.
The roadmap after this PR is to start writing implementations of
ProtocolsHandler
for Kademlia, Ping, Identify, etc. (spoiler: they are already written) and introduce easy ways to combine protocol handlers.