aboutsummaryrefslogtreecommitdiff
path: root/p2p/src/protocols
diff options
context:
space:
mode:
authorhozan23 <hozan23@proton.me>2024-03-20 15:20:21 +0100
committerhozan23 <hozan23@proton.me>2024-03-20 15:20:21 +0100
commit379dca552ca91d22ee007b42f93803ad3dc2b274 (patch)
tree1ba10573b6ec5213baf46f6ab9c3767e0daa4eed /p2p/src/protocols
parent340957fec147f4429796413f27bbd9b84ba6f141 (diff)
core: add the option to create a new task group without providing an
executor & remove GlobalExecutor type
Diffstat (limited to 'p2p/src/protocols')
-rw-r--r--p2p/src/protocols/ping.rs5
1 files changed, 2 insertions, 3 deletions
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 {