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:
Gregory Terzian authored and Gav Wood committed 2019-02-27 09:19:57 +01:00
1 parent 64685c0536
commit 5282615416
4 files changed
+100 -61

No files matched your search

@@ -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 || {