From 3c85b2986542e9e9dcb9a8ee2bd114dbb16dd0da Mon Sep 17 00:00:00 2001 From: ad hoc Date: Wed, 25 May 2022 09:26:11 +0200 Subject: [PATCH] add doc to BatchHandler --- meilisearch-lib/src/tasks/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meilisearch-lib/src/tasks/mod.rs b/meilisearch-lib/src/tasks/mod.rs index a8cb74aed..d8bc25bb7 100644 --- a/meilisearch-lib/src/tasks/mod.rs +++ b/meilisearch-lib/src/tasks/mod.rs @@ -28,6 +28,9 @@ pub trait BatchHandler: Sync + Send + 'static { fn accept(&self, batch: &Batch) -> bool; /// Processes the `Task` batch returning the batch with the `Task` updated. + /// + /// It is ok for this function to panic if a batch is handed that hasn't been verified by + /// `accept` beforehand. async fn process_batch(&self, batch: Batch) -> Batch; /// `finish` is called when the result of `process` has been commited to the task store. This