From 2b032229e46293af92db798a36793c6b8b97baee Mon Sep 17 00:00:00 2001 From: hozan23 Date: Wed, 29 Nov 2023 00:15:10 +0300 Subject: p2p/protocol: improve the Protocol API --- p2p/src/protocol.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'p2p/src/protocol.rs') diff --git a/p2p/src/protocol.rs b/p2p/src/protocol.rs index 8ddc685..582502e 100644 --- a/p2p/src/protocol.rs +++ b/p2p/src/protocol.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use async_trait::async_trait; -use karyons_core::{event::EventValue, Executor}; +use karyons_core::event::EventValue; use crate::{peer::ArcPeer, version::Version, Result}; @@ -56,7 +56,7 @@ impl EventValue for ProtocolEvent { /// /// #[async_trait] /// impl Protocol for NewProtocol { -/// async fn start(self: Arc, ex: Arc>) -> Result<(), P2pError> { +/// async fn start(self: Arc) -> Result<(), P2pError> { /// let listener = self.peer.register_listener::().await; /// loop { /// let event = listener.recv().await.unwrap(); @@ -103,7 +103,7 @@ impl EventValue for ProtocolEvent { #[async_trait] pub trait Protocol: Send + Sync { /// Start the protocol - async fn start(self: Arc, ex: Executor<'_>) -> Result<()>; + async fn start(self: Arc) -> Result<()>; /// Returns the version of the protocol. fn version() -> Result -- cgit v1.2.3