mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 23:31:04 +00:00
Add names to tokio threads (#1866)
This commit is contained in:
committed by
Robert Habermeier
parent
077ed00951
commit
34fccecc02
@@ -35,7 +35,7 @@ use runtime_primitives::traits::{Block as BlockT, NumberFor};
|
|||||||
use crate::specialization::NetworkSpecialization;
|
use crate::specialization::NetworkSpecialization;
|
||||||
|
|
||||||
use tokio::prelude::task::AtomicTask;
|
use tokio::prelude::task::AtomicTask;
|
||||||
use tokio::runtime::Runtime;
|
use tokio::runtime::Builder as RuntimeBuilder;
|
||||||
|
|
||||||
pub use network_libp2p::PeerId;
|
pub use network_libp2p::PeerId;
|
||||||
|
|
||||||
@@ -458,7 +458,7 @@ fn start_thread<B: BlockT + 'static, S: NetworkSpecialization<B>>(
|
|||||||
|
|
||||||
let (close_tx, close_rx) = oneshot::channel();
|
let (close_tx, close_rx) = oneshot::channel();
|
||||||
let service_clone = service.clone();
|
let service_clone = service.clone();
|
||||||
let mut runtime = Runtime::new()?;
|
let mut runtime = RuntimeBuilder::new().name_prefix("libp2p-").build()?;
|
||||||
let thread = thread::Builder::new().name("network".to_string()).spawn(move || {
|
let thread = thread::Builder::new().name("network".to_string()).spawn(move || {
|
||||||
let fut = run_thread(protocol_sender, service_clone, network_port, protocol_id)
|
let fut = run_thread(protocol_sender, service_clone, network_port, protocol_id)
|
||||||
.select(close_rx.then(|_| Ok(())))
|
.select(close_rx.then(|_| Ok(())))
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ pub mod chain_spec;
|
|||||||
mod service;
|
mod service;
|
||||||
|
|
||||||
use tokio::prelude::Future;
|
use tokio::prelude::Future;
|
||||||
use tokio::runtime::Runtime;
|
use tokio::runtime::{Builder as RuntimeBuilder, Runtime};
|
||||||
pub use cli::{VersionInfo, IntoExit, NoCustom};
|
pub use cli::{VersionInfo, IntoExit, NoCustom};
|
||||||
use substrate_service::{ServiceFactory, Roles as ServiceRoles};
|
use substrate_service::{ServiceFactory, Roles as ServiceRoles};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
@@ -87,7 +87,8 @@ pub fn run<I, T, E>(args: I, exit: E, version: cli::VersionInfo) -> error::Resul
|
|||||||
info!("Chain specification: {}", config.chain_spec.name());
|
info!("Chain specification: {}", config.chain_spec.name());
|
||||||
info!("Node name: {}", config.name);
|
info!("Node name: {}", config.name);
|
||||||
info!("Roles: {:?}", config.roles);
|
info!("Roles: {:?}", config.roles);
|
||||||
let runtime = Runtime::new().map_err(|e| format!("{:?}", e))?;
|
let runtime = RuntimeBuilder::new().name_prefix("main-tokio-").build()
|
||||||
|
.map_err(|e| format!("{:?}", e))?;
|
||||||
let executor = runtime.executor();
|
let executor = runtime.executor();
|
||||||
match config.roles {
|
match config.roles {
|
||||||
ServiceRoles::LIGHT => run_until_exit(
|
ServiceRoles::LIGHT => run_until_exit(
|
||||||
|
|||||||
Reference in New Issue
Block a user