From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- third_party/rust/interrupt-support/src/shutdown.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'third_party/rust/interrupt-support/src/shutdown.rs') diff --git a/third_party/rust/interrupt-support/src/shutdown.rs b/third_party/rust/interrupt-support/src/shutdown.rs index 9c64df27e8..88a56029b8 100644 --- a/third_party/rust/interrupt-support/src/shutdown.rs +++ b/third_party/rust/interrupt-support/src/shutdown.rs @@ -12,13 +12,14 @@ License, v. 2.0. If a copy of the MPL was not distributed with this /// /// Here's how add shutdown support to a component: /// -/// - Use `SqlInterruptScope::new_with_shutdown_check()` to create a new -/// `SqlInterruptScope` /// - Database connections need to be wrapped in a type that: /// - Implements `AsRef`. /// - Gets wrapped in an `Arc<>`. This is needed so the shutdown code can get a weak reference to /// the instance. /// - Calls `register_interrupt()` on creation +/// - Use `SqlInterruptScope::begin_interrupt_scope()` before each operation. +/// This will return an error if shutdown mode is in effect. +/// The interrupt scope should be periodically checked to handle the operation being interrupted/shutdown after it started. /// /// See `PlacesDb::begin_interrupt_scope()` and `PlacesApi::new_connection()` for an example of /// how this works. -- cgit v1.2.3