Send a WakeUp when writing data in the BBQueue buffers

This commit is contained in:
Clément Renault 2024-11-27 13:59:29 +01:00
parent 08d6413365
commit acec45ad7c
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F
2 changed files with 107 additions and 53 deletions

View file

@ -422,6 +422,12 @@ impl<'b> ExtractorBbqueueSender<'b> {
// We could commit only the used memory.
grant.commit(total_length);
// We only send a wake up message when the channel is empty
// so that we don't fill the channel with too many WakeUps.
if self.sender.is_empty() {
self.sender.send(ReceiverAction::WakeUp).unwrap();
}
Ok(())
}
@ -460,6 +466,12 @@ impl<'b> ExtractorBbqueueSender<'b> {
// We could commit only the used memory.
grant.commit(total_length);
// We only send a wake up message when the channel is empty
// so that we don't fill the channel with too many WakeUps.
if self.sender.is_empty() {
self.sender.send(ReceiverAction::WakeUp).unwrap();
}
Ok(())
}
@ -511,6 +523,12 @@ impl<'b> ExtractorBbqueueSender<'b> {
// We could commit only the used memory.
grant.commit(total_length);
// We only send a wake up message when the channel is empty
// so that we don't fill the channel with too many WakeUps.
if self.sender.is_empty() {
self.sender.send(ReceiverAction::WakeUp).unwrap();
}
Ok(())
}
@ -561,6 +579,12 @@ impl<'b> ExtractorBbqueueSender<'b> {
// We could commit only the used memory.
grant.commit(total_length);
// We only send a wake up message when the channel is empty
// so that we don't fill the channel with too many WakeUps.
if self.sender.is_empty() {
self.sender.send(ReceiverAction::WakeUp).unwrap();
}
Ok(())
}
}