From 5baf14594331b1b0b60d655240eb398bcce61f7c Mon Sep 17 00:00:00 2001 From: hozan23 Date: Thu, 21 Mar 2024 12:28:47 +0100 Subject: core: minor modification to TaskGroup api --- p2p/src/connector.rs | 2 +- p2p/src/discovery/mod.rs | 2 +- p2p/src/discovery/refresh.rs | 2 +- p2p/src/listener.rs | 2 +- p2p/src/peer/mod.rs | 2 +- p2p/src/peer_pool.rs | 2 +- p2p/src/protocols/ping.rs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) (limited to 'p2p') diff --git a/p2p/src/connector.rs b/p2p/src/connector.rs index 9bf63f9..de9e746 100644 --- a/p2p/src/connector.rs +++ b/p2p/src/connector.rs @@ -52,7 +52,7 @@ impl Connector { Arc::new(Self { key_pair: key_pair.clone(), max_retries, - task_group: TaskGroup::new(ex), + task_group: TaskGroup::with_executor(ex), monitor, connection_slots, enable_tls, diff --git a/p2p/src/discovery/mod.rs b/p2p/src/discovery/mod.rs index 4b54233..3e437aa 100644 --- a/p2p/src/discovery/mod.rs +++ b/p2p/src/discovery/mod.rs @@ -116,7 +116,7 @@ impl Discovery { outbound_slots, connector, listener, - task_group: TaskGroup::new(ex), + task_group: TaskGroup::with_executor(ex), config, }) } diff --git a/p2p/src/discovery/refresh.rs b/p2p/src/discovery/refresh.rs index e56f0eb..035a581 100644 --- a/p2p/src/discovery/refresh.rs +++ b/p2p/src/discovery/refresh.rs @@ -70,7 +70,7 @@ impl RefreshService { Self { table, listen_endpoint, - task_group: TaskGroup::new(executor.clone()), + task_group: TaskGroup::with_executor(executor.clone()), executor, config, monitor, diff --git a/p2p/src/listener.rs b/p2p/src/listener.rs index c9b7390..4a41482 100644 --- a/p2p/src/listener.rs +++ b/p2p/src/listener.rs @@ -46,7 +46,7 @@ impl Listener { Arc::new(Self { key_pair: key_pair.clone(), connection_slots, - task_group: TaskGroup::new(ex), + task_group: TaskGroup::with_executor(ex), enable_tls, monitor, }) diff --git a/p2p/src/peer/mod.rs b/p2p/src/peer/mod.rs index 1fc5ccf..ca68530 100644 --- a/p2p/src/peer/mod.rs +++ b/p2p/src/peer/mod.rs @@ -76,7 +76,7 @@ impl Peer { remote_endpoint, conn_direction, protocol_events: EventSys::new(), - task_group: TaskGroup::new(ex), + task_group: TaskGroup::with_executor(ex), stop_chan: channel::bounded(1), }) } diff --git a/p2p/src/peer_pool.rs b/p2p/src/peer_pool.rs index 48499fe..4e20c99 100644 --- a/p2p/src/peer_pool.rs +++ b/p2p/src/peer_pool.rs @@ -80,7 +80,7 @@ impl PeerPool { peers: Mutex::new(HashMap::new()), protocols, protocol_versions, - task_group: TaskGroup::new(executor.clone()), + task_group: TaskGroup::with_executor(executor.clone()), executor, monitor, config, diff --git a/p2p/src/protocols/ping.rs b/p2p/src/protocols/ping.rs index 4885c1e..f04e059 100644 --- a/p2p/src/protocols/ping.rs +++ b/p2p/src/protocols/ping.rs @@ -50,7 +50,7 @@ impl PingProtocol { peer, ping_interval, ping_timeout, - task_group: TaskGroup::new(executor), + task_group: TaskGroup::with_executor(executor), }) } -- cgit v1.2.3