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/peer_pool.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'p2p/src/peer_pool.rs') diff --git a/p2p/src/peer_pool.rs b/p2p/src/peer_pool.rs index ead6d8f..48499fe 100644 --- a/p2p/src/peer_pool.rs +++ b/p2p/src/peer_pool.rs @@ -11,9 +11,8 @@ use smol::{ }; use karyon_core::{ - async_util::{TaskGroup, TaskResult}, + async_util::{Executor, TaskGroup, TaskResult}, util::decode, - GlobalExecutor, }; use karyon_net::Conn; @@ -54,7 +53,7 @@ pub struct PeerPool { task_group: TaskGroup<'static>, /// A global Executor - executor: GlobalExecutor, + executor: Executor<'static>, /// The Configuration for the P2P network. pub(crate) config: Arc, @@ -70,7 +69,7 @@ impl PeerPool { conn_queue: Arc, config: Arc, monitor: Arc, - executor: GlobalExecutor, + executor: Executor<'static>, ) -> Arc { let protocols = RwLock::new(HashMap::new()); let protocol_versions = Arc::new(RwLock::new(HashMap::new())); -- cgit v1.2.3