mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Send a WakeUp when writing data in the BBQueue buffers
This commit is contained in:
parent
08d6413365
commit
acec45ad7c
2 changed files with 107 additions and 53 deletions
|
@ -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(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue