Skip to content

Commit

Permalink
perf: use a blocking task to process transmission responses in the wo…
Browse files Browse the repository at this point in the history
…rker

Signed-off-by: ljedrz <ljedrz@gmail.com>
  • Loading branch information
ljedrz committed Mar 4, 2024
1 parent 8be6ac9 commit 0d98b73
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion node/bft/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,15 @@ impl<N: Network> Worker<N> {
self.spawn(async move {
while let Some((peer_ip, transmission_response)) = rx_transmission_response.recv().await {
// Process the transmission response.
self_.finish_transmission_request(peer_ip, transmission_response);
let self__ = self_.clone();
if tokio::task::spawn_blocking(move || {
self__.finish_transmission_request(peer_ip, transmission_response);
})
.await
.is_err()
{
error!("Failed to await on Worker::finish_transmission_request");
}
}
});
}
Expand Down

0 comments on commit 0d98b73

Please sign in to comment.