pub struct CacheLock { /* private fields */ }Expand description
The global cache locking manager
Implementations§
Source§impl CacheLock
impl CacheLock
Sourcepub fn new_boxed(age_timeout: Duration) -> Box<Self>
pub fn new_boxed(age_timeout: Duration) -> Box<Self>
Create a new CacheLock with the given lock timeout
Age timeout refers to how long a writer has been holding onto a particular lock, and wait timeout refers to how long a reader may hold onto any number of locks before giving up. When either timeout is reached, the read locks are automatically unlocked.
Sourcepub fn new(age_timeout_default: Duration) -> Self
pub fn new(age_timeout_default: Duration) -> Self
Create a new CacheLock with the given lock timeout
Age timeout refers to how long a writer has been holding onto a particular lock, and wait timeout refers to how long a reader may hold onto any number of locks before giving up. When either timeout is reached, the read locks are automatically unlocked.
Trait Implementations§
Source§impl CacheKeyLock for CacheLock
impl CacheKeyLock for CacheLock
Source§fn lock(&self, key: &CacheKey, stale_writer: bool) -> Locked
fn lock(&self, key: &CacheKey, stale_writer: bool) -> Locked
Try to lock a cache fetch Read more
Source§fn release(&self, key: &CacheKey, permit: WritePermit, reason: LockStatus)
fn release(&self, key: &CacheKey, permit: WritePermit, reason: LockStatus)
Release a lock for the given key Read more
Source§fn trace_lock_wait(
&self,
span: &mut Span,
_read_lock: &ReadLock,
lock_status: LockStatus,
)
fn trace_lock_wait( &self, span: &mut Span, _read_lock: &ReadLock, lock_status: LockStatus, )
Set tags on a trace span for the cache lock wait.
Source§fn custom_lock_status(&self, _custom_no_cache: &'static str) -> LockStatus
fn custom_lock_status(&self, _custom_no_cache: &'static str) -> LockStatus
Set a lock status for a custom
NoCacheReason.Auto Trait Implementations§
impl !Freeze for CacheLock
impl !RefUnwindSafe for CacheLock
impl Send for CacheLock
impl Sync for CacheLock
impl Unpin for CacheLock
impl !UnwindSafe for CacheLock
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