rename batch_handler to handler

This commit is contained in:
ad hoc 2022-05-25 08:46:06 +02:00
parent 0f9c134114
commit 64654ef7c3
No known key found for this signature in database
GPG key ID: 4F00A782990CC643
6 changed files with 3 additions and 3 deletions

View file

@ -0,0 +1,20 @@
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) {
()
}
}