WorkerTaskContext: add shutdown_requested() and fail_on_shutdown()

This commit is contained in:
Dietmar Maurer
2021-09-24 11:56:53 +02:00
parent 619cd5cbcb
commit 0fd55b08d9
6 changed files with 37 additions and 11 deletions

View File

@ -853,6 +853,14 @@ impl WorkerTaskContext for WorkerTask {
self.abort_requested.load(Ordering::SeqCst)
}
fn shutdown_requested(&self) -> bool {
crate::shutdown_requested()
}
fn fail_on_shutdown(&self) -> Result<(), Error> {
crate::fail_on_shutdown()
}
fn log(&self, level: log::Level, message: &std::fmt::Arguments) {
match level {
log::Level::Error => self.log_warning(&message.to_string()),