pub struct LockManager { /* private fields */ }Expand description
Thread-safe map from workflow Reference to per-workflow lock.
Used by higher-level workspace APIs to coordinate exclusive write access.
The Default implementation is used for the global singleton.
Implementations§
Source§impl LockManager
impl LockManager
Sourcepub fn get_mutex(reference: Arc<Reference>) -> Arc<Mutex<()>>
pub fn get_mutex(reference: Arc<Reference>) -> Arc<Mutex<()>>
Acquires a workflow lock and returns a mutex for transactional use.
The caller must call .lock() on the returned mutex to acquire the actual lock.
Sourcepub fn get_mutex_with_error_handling(
reference: Arc<Reference>,
) -> Result<Arc<Mutex<()>>>
pub fn get_mutex_with_error_handling( reference: Arc<Reference>, ) -> Result<Arc<Mutex<()>>>
Enhanced lock acquisition with anyhow-compatible error handling Provides detailed error information for both poisoning and contention
Sourcepub fn try_get_mutex_with_timeout(
reference: Arc<Reference>,
timeout: Duration,
) -> Result<Arc<Mutex<()>>>
pub fn try_get_mutex_with_timeout( reference: Arc<Reference>, timeout: Duration, ) -> Result<Arc<Mutex<()>>>
Try to acquire lock with timeout
Sourcepub fn is_locked(&self, reference: &Arc<Reference>) -> bool
pub fn is_locked(&self, reference: &Arc<Reference>) -> bool
Checks if a workflow is currently locked.
Sourcepub fn get_lock_metrics(&self) -> HashMap<String, u64>
pub fn get_lock_metrics(&self) -> HashMap<String, u64>
Get lock metrics for monitoring and debugging
pub fn get_mutex_with_debug_error_handling( reference: Arc<Reference>, ) -> Result<Arc<Mutex<()>>>
Trait Implementations§
Source§impl Debug for LockManager
impl Debug for LockManager
Source§impl Default for LockManager
impl Default for LockManager
Source§fn default() -> LockManager
fn default() -> LockManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for LockManager
impl !RefUnwindSafe for LockManager
impl Send for LockManager
impl Sync for LockManager
impl Unpin for LockManager
impl UnwindSafe for LockManager
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