diff options
author | hozan23 <hozan23@proton.me> | 2024-03-20 15:20:21 +0100 |
---|---|---|
committer | hozan23 <hozan23@proton.me> | 2024-03-20 15:20:21 +0100 |
commit | 379dca552ca91d22ee007b42f93803ad3dc2b274 (patch) | |
tree | 1ba10573b6ec5213baf46f6ab9c3767e0daa4eed /p2p/src/discovery/refresh.rs | |
parent | 340957fec147f4429796413f27bbd9b84ba6f141 (diff) |
core: add the option to create a new task group without providing an
executor & remove GlobalExecutor type
Diffstat (limited to 'p2p/src/discovery/refresh.rs')
-rw-r--r-- | p2p/src/discovery/refresh.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/p2p/src/discovery/refresh.rs b/p2p/src/discovery/refresh.rs index bfcab56..e56f0eb 100644 --- a/p2p/src/discovery/refresh.rs +++ b/p2p/src/discovery/refresh.rs @@ -10,9 +10,8 @@ use smol::{ }; use karyon_core::{ - async_util::{timeout, Backoff, TaskGroup, TaskResult}, + async_util::{timeout, Backoff, Executor, TaskGroup, TaskResult}, util::{decode, encode}, - GlobalExecutor, }; use karyon_net::{udp, Connection, Endpoint, NetError}; @@ -46,7 +45,7 @@ pub struct RefreshService { task_group: TaskGroup<'static>, /// A global executor - executor: GlobalExecutor, + executor: Executor<'static>, /// Holds the configuration for the P2P network. config: Arc<Config>, @@ -61,7 +60,7 @@ impl RefreshService { config: Arc<Config>, table: Arc<Mutex<RoutingTable>>, monitor: Arc<Monitor>, - executor: GlobalExecutor, + executor: Executor<'static>, ) -> Self { let listen_endpoint = config .listen_endpoint |