From 379dca552ca91d22ee007b42f93803ad3dc2b274 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Wed, 20 Mar 2024 15:20:21 +0100 Subject: core: add the option to create a new task group without providing an executor & remove GlobalExecutor type --- p2p/src/protocols/ping.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'p2p/src/protocols') diff --git a/p2p/src/protocols/ping.rs b/p2p/src/protocols/ping.rs index 22c1b3d..4885c1e 100644 --- a/p2p/src/protocols/ping.rs +++ b/p2p/src/protocols/ping.rs @@ -12,10 +12,9 @@ use smol::{ }; use karyon_core::{ - async_util::{select, timeout, Either, TaskGroup, TaskResult}, + async_util::{select, timeout, Either, Executor, TaskGroup, TaskResult}, event::EventListener, util::decode, - GlobalExecutor, }; use karyon_net::NetError; @@ -44,7 +43,7 @@ pub struct PingProtocol { impl PingProtocol { #[allow(clippy::new_ret_no_self)] - pub fn new(peer: ArcPeer, executor: GlobalExecutor) -> ArcProtocol { + pub fn new(peer: ArcPeer, executor: Executor<'static>) -> ArcProtocol { let ping_interval = peer.config().ping_interval; let ping_timeout = peer.config().ping_timeout; Arc::new(Self { -- cgit v1.2.3