Skip to content

Commit dca89af

Browse files
committed
perf: use a blocking task to process transmission responses in the worker
Signed-off-by: ljedrz <ljedrz@gmail.com>
1 parent 8be6ac9 commit dca89af

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

node/bft/src/worker.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use crate::{
1616
events::{Event, TransmissionRequest, TransmissionResponse},
1717
helpers::{fmt_id, max_redundant_requests, Pending, Ready, Storage, WorkerReceiver},
18+
spawn_blocking,
1819
ProposedBatch,
1920
Transport,
2021
MAX_FETCH_TIMEOUT_IN_MS,
@@ -376,7 +377,11 @@ impl<N: Network> Worker<N> {
376377
self.spawn(async move {
377378
while let Some((peer_ip, transmission_response)) = rx_transmission_response.recv().await {
378379
// Process the transmission response.
379-
self_.finish_transmission_request(peer_ip, transmission_response);
380+
let self__ = self_.clone();
381+
let _ = spawn_blocking!({
382+
self__.finish_transmission_request(peer_ip, transmission_response);
383+
Ok(())
384+
});
380385
}
381386
});
382387
}

0 commit comments

Comments
 (0)