SQLite engine: named locks — try_lock, SqliteLockHandle, duration guards (task sqlite-engine-locks)
This commit is contained in:
1 parent
513df0b311
commit
1edcb0e27d
5 files changed
+640
-13
No files matched your search
@@ -199,11 +199,15 @@ impl Store for SqliteStore {
|
||||
|
||||
fn try_lock<'a>(
|
||||
&'a self,
|
||||
_name: &str,
|
||||
_owner: &str,
|
||||
_ttl: i64,
|
||||
name: &str,
|
||||
owner: &str,
|
||||
ttl: i64,
|
||||
) -> alkstore::BoxedFuture<'a, alkstore::Result<Option<Box<dyn alkstore::Lock>>>> {
|
||||
Box::pin(async { Err(database_error("lock wiring lands with the mechanism tasks")) })
|
||||
let name = name.to_string();
|
||||
let owner = owner.to_string();
|
||||
let writer = self.writer.clone();
|
||||
let closed = self.closed.clone();
|
||||
crate::lock::try_lock(&name, &owner, ttl, writer, closed)
|
||||
}
|
||||
|
||||
fn schedule<'a>(
|
||||
@@ -241,6 +245,8 @@ impl Store for SqliteStore {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod lock_tests;
|
||||
#[cfg(test)]
|
||||
mod notify_tests;
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in new issue
Block a user