diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b603a1..8f77d9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +* Add `DB::cancel_all_background_work` method (stanislav-tkach) + ## 0.15.0 (2020-08-25) * Fix building rocksdb library on windows host (aleksuss) diff --git a/src/db.rs b/src/db.rs index 38b84ca..9443146 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1361,6 +1361,13 @@ impl DB { Ok(()) } } + + /// Request stopping background work, if wait is true wait until it's done. + pub fn cancel_all_background_work(&self, wait: bool) { + unsafe { + ffi::rocksdb_cancel_all_background_work(self.inner, wait as u8); + } + } } impl Drop for DB {