pub fn new<V: 'static + Verifier<B>>(
		verifier: V,
		block_import: BoxBlockImport<B, Transaction>,
		justification_import: Option<BoxJustificationImport<B>>,
		spawner: &impl sp_core::traits::SpawnNamed,
		prometheus_registry: Option<&Registry>,
	) -> Self {
		let (result_sender, result_port) = buffered_link::buffered_link();

		let metrics = prometheus_registry.and_then(|r| {
			Metrics::register(r)
				.map_err(|err| {
					log::warn!("Failed to register Prometheus metrics: {}", err);
				})
				.ok()
		});

		let (future, justification_sender, block_import_sender) = BlockImportWorker::new(
			result_sender,
			verifier,
			block_import,
			justification_import,
			metrics,
		);

		spawner.spawn_blocking("basic-block-import-worker", future.boxed());

		Self {
			justification_sender,
			block_import_sender,
			result_port,
			_phantom: PhantomData,
		}
	}
/// Instantiate a new basic queue, with given verifier.
///
/// This creates a background task, and calls `on_start` on the justification importer.
Instantiate a new basic queue, with given verifier.
This creates a background task, and calls `on_start` on the justification importer.
Instantiate a new basic queue with given verifier . This creates a background task and calls ` on_start ` on the justification importer .
pub fn new<V: 'static + Verifier<B>>(
		verifier: V,
		block_import: BoxBlockImport<B, Transaction>,
		justification_import: Option<BoxJustificationImport<B>>,
		spawner: &impl sp_core::traits::SpawnNamed,
		prometheus_registry: Option<&Registry>,
	) -> Self {
		let (result_sender, result_port) = buffered_link::buffered_link();
		let metrics = prometheus_registry.and_then(|r| {
			Metrics::register(r)
				.map_err(|err| {
					log::warn!("Failed to register Prometheus metrics: {}", err);
				})
				.ok()
		});
		let (future, justification_sender, block_import_sender) = BlockImportWorker::new(
			result_sender,
			verifier,
			block_import,
			justification_import,
			metrics,
		);
		spawner.spawn_blocking("basic-block-import-worker", future.boxed());
		Self {
			justification_sender,
			block_import_sender,
			result_port,
			_phantom: PhantomData,
		}
	}
pub fn new < V : ' static + Verifier < B > > ( verifier : V , block_import : BoxBlockImport < B , Transaction > , justification_import : Option < BoxJustificationImport < B > > , spawner : & impl sp_core :: traits :: SpawnNamed , prometheus_registry : Option < & Registry > , ) -> Self { let ( result_sender , result_port ) = buffered_link :: buffered_link ( ) ; let metrics = prometheus_registry . and_then ( | r | { Metrics :: register ( r ) . map_err ( | err | { log :: warn ! ( " " err ) ; } ) . ok ( ) } ) ; let ( future , justification_sender , block_import_sender ) = BlockImportWorker :: new ( result_sender , verifier , block_import , justification_import , metrics , ) ; spawner . spawn_blocking ( " " , future . boxed ( ) ) ; Self { justification_sender , block_import_sender , result_port , _phantom : PhantomData , } }
Instantiate a new basic queue, with given verifier.
Instantiate a new basic queue with given verifier .
verifier
V
block_import
BoxBlockImport<B, Transaction>
justification_import
Option<BoxJustificationImport<B>>
spawner
&impl sp_core::traits::SpawnNamed
prometheus_registry
Option<&Registry>
verifier
V
block_import
BoxBlockImport<B, Transaction>
justification_import
Option<BoxJustificationImport<B>>
spawner
&impl sp_core::traits::SpawnNamed
prometheus_registry
Option<&Registry>