mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-06-02 02:48:03 +02:00
19 lines
447 B
Rust
19 lines
447 B
Rust
use crate::tasks::batch::{Batch, BatchContent};
|
|
use crate::tasks::BatchHandler;
|
|
|
|
/// A sink handler for empty tasks.
|
|
pub struct EmptyBatchHandler;
|
|
|
|
#[async_trait::async_trait]
|
|
impl BatchHandler for EmptyBatchHandler {
|
|
fn accept(&self, batch: &Batch) -> bool {
|
|
matches!(batch.content, BatchContent::Empty)
|
|
}
|
|
|
|
async fn process_batch(&self, batch: Batch) -> Batch {
|
|
batch
|
|
}
|
|
|
|
async fn finish(&self, _: &Batch) {}
|
|
}
|