Skip to content

Commit

Permalink
Remove unnecessary spawn from message handler
Browse files Browse the repository at this point in the history
  • Loading branch information
viquezclaudio authored and jsdanielh committed May 6, 2024
1 parent b196828 commit 41a666c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions network-interface/src/request/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,10 @@ pub fn message_handler<
.for_each_concurrent(MAX_CONCURRENT_HANDLERS, |(msg, peer_id)| {
let req_environment = req_environment.clone();
async move {
let req_environment = req_environment.clone();
log::trace!("{:?} {:#?}", peer_id, msg);

tokio::spawn(async move {
log::trace!("{:?} {:#?}", peer_id, msg);

// Messages do not have a response (so the response is ignored)
msg.message_handle(peer_id, &req_environment);
})
.await
.expect("Request handler panicked")
// Messages do not have a response (so the response is ignored)
msg.message_handle(peer_id, &req_environment);
}
})
.await
Expand Down

0 comments on commit 41a666c

Please sign in to comment.