pub struct WorkspaceLockManager { /* private fields */ }Expand description
Manages per-project mutex locks to ensure concurrent runs for the same project are safely serialized without corrupting the persistent remote workspace.
Implementations§
Source§impl WorkspaceLockManager
impl WorkspaceLockManager
pub fn new() -> Self
Sourcepub async fn get_lock(&self, project: &str) -> Arc<Mutex<()>> ⓘ
pub async fn get_lock(&self, project: &str) -> Arc<Mutex<()>> ⓘ
Retrieve the shared mutex for the given project name.
Sourcepub async fn is_locked(&self, project: &str) -> bool
pub async fn is_locked(&self, project: &str) -> bool
Whether a run currently holds this project’s lock.
Non-inserting: projects with no lock entry are never locked. Used by GC and CLEAN paths to avoid deleting workspaces that are in use.
Sourcepub async fn locked_projects(&self) -> Vec<String>
pub async fn locked_projects(&self) -> Vec<String>
Snapshot of project names whose locks are currently held. Callers building synchronous predicates (e.g. GC filters) use this to avoid holding the manager’s map across blocking work.
Trait Implementations§
Source§impl Clone for WorkspaceLockManager
impl Clone for WorkspaceLockManager
Auto Trait Implementations§
impl !RefUnwindSafe for WorkspaceLockManager
impl !UnwindSafe for WorkspaceLockManager
impl Freeze for WorkspaceLockManager
impl Send for WorkspaceLockManager
impl Sync for WorkspaceLockManager
impl Unpin for WorkspaceLockManager
impl UnsafeUnpin for WorkspaceLockManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more