mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Move spawning tasks from thread pools to Service's TaskManager for block importing (#5647)
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@@ -38,7 +38,7 @@ pub struct Configuration {
|
||||
/// Node role.
|
||||
pub role: Role,
|
||||
/// How to spawn background tasks. Mandatory, otherwise creating a `Service` will error.
|
||||
pub task_executor: Arc<dyn Fn(Pin<Box<dyn Future<Output = ()> + Send>>) + Send + Sync>,
|
||||
pub task_executor: Arc<dyn Fn(Pin<Box<dyn Future<Output = ()> + Send>>, TaskType) + Send + Sync>,
|
||||
/// Extrinsic pool configuration.
|
||||
pub transaction_pool: TransactionPoolOptions,
|
||||
/// Network configuration.
|
||||
@@ -102,6 +102,15 @@ pub struct Configuration {
|
||||
pub announce_block: bool,
|
||||
}
|
||||
|
||||
/// Type for tasks spawned by the executor.
|
||||
#[derive(PartialEq)]
|
||||
pub enum TaskType {
|
||||
/// Regular non-blocking futures. Polling the task is expected to be a lightweight operation.
|
||||
Async,
|
||||
/// The task might perform a lot of expensive CPU operations and/or call `thread::sleep`.
|
||||
Blocking,
|
||||
}
|
||||
|
||||
/// Configuration of the client keystore.
|
||||
#[derive(Clone)]
|
||||
pub enum KeystoreConfig {
|
||||
|
||||
Reference in New Issue
Block a user