Add MustStopProcessing::as_lambda

This commit is contained in:
Louis Dureuil
2025-10-02 16:50:44 +02:00
parent 43a6505435
commit d41716d8f0

View File

@@ -50,6 +50,11 @@ impl MustStopProcessing {
pub fn reset(&self) { pub fn reset(&self) {
self.0.store(false, Ordering::Relaxed); self.0.store(false, Ordering::Relaxed);
} }
pub fn as_lambda(&self) -> impl Fn() -> bool + Send + Sync + 'static {
let clone = self.clone();
move || clone.get()
}
} }
pub struct Scheduler { pub struct Scheduler {