mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 10:01:17 +00:00
create parallel tasks extension (#5249)
This commit is contained in:
@@ -263,6 +263,7 @@ fn new_full_parts<TBl, TRtApi, TExecDisp>(
|
||||
fork_blocks,
|
||||
bad_blocks,
|
||||
extensions,
|
||||
Box::new(tasks_builder.spawn_handle()),
|
||||
config.prometheus_config.as_ref().map(|config| config.registry.clone()),
|
||||
)?
|
||||
};
|
||||
@@ -366,6 +367,7 @@ impl ServiceBuilder<(), (), (), (), (), (), (), (), (), (), ()> {
|
||||
sc_client::light::new_fetch_checker::<_, TBl, _>(
|
||||
light_blockchain.clone(),
|
||||
executor.clone(),
|
||||
Box::new(tasks_builder.spawn_handle()),
|
||||
),
|
||||
);
|
||||
let fetcher = Arc::new(sc_network::config::OnDemand::new(fetch_checker));
|
||||
@@ -375,6 +377,7 @@ impl ServiceBuilder<(), (), (), (), (), (), (), (), (), (), ()> {
|
||||
backend.clone(),
|
||||
config.expect_chain_spec().as_storage_builder(),
|
||||
executor,
|
||||
Box::new(tasks_builder.spawn_handle()),
|
||||
config.prometheus_config.as_ref().map(|config| config.registry.clone()),
|
||||
)?);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ use futures::{
|
||||
compat::*,
|
||||
task::{Spawn, FutureObj, SpawnError},
|
||||
};
|
||||
use sc_client_api::CloneableSpawn;
|
||||
|
||||
/// Type alias for service task executor (usually runtime).
|
||||
pub type ServiceTaskExecutor = Arc<dyn Fn(Pin<Box<dyn Future<Output = ()> + Send>>) + Send + Sync>;
|
||||
@@ -118,6 +119,12 @@ impl Spawn for SpawnTaskHandle {
|
||||
}
|
||||
}
|
||||
|
||||
impl sc_client_api::CloneableSpawn for SpawnTaskHandle {
|
||||
fn clone(&self) -> Box<dyn CloneableSpawn> {
|
||||
Box::new(Clone::clone(self))
|
||||
}
|
||||
}
|
||||
|
||||
type Boxed01Future01 = Box<dyn futures01::Future<Item = (), Error = ()> + Send + 'static>;
|
||||
|
||||
impl futures01::future::Executor<Boxed01Future01> for SpawnTaskHandle {
|
||||
|
||||
Reference in New Issue
Block a user