Skip to content

Commit 52781d6

Browse files
committed
Make async message for ejection
1 parent 1c7463b commit 52781d6

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

crates/batcher/src/lib.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -995,13 +995,18 @@ impl Batcher {
995995
&mut user_guard,
996996
);
997997

998-
// Notify the evicted user
999998
if let Some(ref removed_entry_ws) = removed.messaging_sink {
1000-
send_message(
1001-
removed_entry_ws.clone(),
1002-
SubmitProofResponseMessage::UnderpricedProof,
1003-
)
1004-
.await;
999+
let ws_sink = removed_entry_ws.clone();
1000+
// Usually we just drop the locks, but this time
1001+
// We still need to keep them since we are doing more work
1002+
// So we send the message in an async manner
1003+
tokio::spawn(async move {
1004+
send_message(
1005+
ws_sink,
1006+
SubmitProofResponseMessage::UnderpricedProof,
1007+
)
1008+
.await;
1009+
});
10051010
}
10061011

10071012
evicted_entry = Some(removed);

0 commit comments

Comments
 (0)