mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 13:21:10 +00:00
Use bounded channels for network -> sync -> import (#1874)
* use bounded channels for network -> sync -> import * bound at 4 * indent * use return value of handle_network_msg
This commit is contained in:
committed by
Gav Wood
parent
64685c0536
commit
5282615416
@@ -263,7 +263,7 @@ impl<B: BlockT> BlockImporter<B> {
|
||||
worker_sender: Sender<BlockImportWorkerMsg<B>>,
|
||||
justification_import: Option<SharedJustificationImport<B>>,
|
||||
) -> Sender<BlockImportMsg<B>> {
|
||||
let (sender, port) = channel::unbounded();
|
||||
let (sender, port) = channel::bounded(4);
|
||||
let _ = thread::Builder::new()
|
||||
.name("ImportQueue".into())
|
||||
.spawn(move || {
|
||||
@@ -454,7 +454,7 @@ impl<B: BlockT, V: 'static + Verifier<B>> BlockImportWorker<B, V> {
|
||||
verifier: Arc<V>,
|
||||
block_import: SharedBlockImport<B>,
|
||||
) -> Sender<BlockImportWorkerMsg<B>> {
|
||||
let (sender, port) = channel::unbounded();
|
||||
let (sender, port) = channel::bounded(4);
|
||||
let _ = thread::Builder::new()
|
||||
.name("ImportQueueWorker".into())
|
||||
.spawn(move || {
|
||||
|
||||
Reference in New Issue
Block a user