pub struct InMemoryLock { /* private fields */ }Expand description
In-memory Lock backed by a Mutex<{ locked, waiters }>.
The std Mutex is held only for the brief state check/update — never across
an .await — so it never blocks the executor. Acquisition returns a future
that, while the lock is held, registers the task’s waker and yields
Pending; unlock wakes all registered waiters so they re-contend (one
wins, the rest re-register). Runtime-agnostic: no dependency on any async
runtime, matching the rest of the crate’s RPITIT async surface.
Implementations§
Source§impl InMemoryLock
impl InMemoryLock
Trait Implementations§
Source§impl Default for InMemoryLock
impl Default for InMemoryLock
Auto Trait Implementations§
impl !Freeze for InMemoryLock
impl RefUnwindSafe for InMemoryLock
impl Send for InMemoryLock
impl Sync for InMemoryLock
impl Unpin for InMemoryLock
impl UnsafeUnpin for InMemoryLock
impl UnwindSafe for InMemoryLock
Blanket Implementations§
Source§impl<T> AggregateBuilder for T
impl<T> AggregateBuilder for T
fn aggregate<A: Aggregate>(self) -> AggregateRepository<Self, A>
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
Source§impl<T> Queueable for T
impl<T> Queueable for T
Source§fn queued(self) -> QueuedRepository<Self, InMemoryLockManager>
fn queued(self) -> QueuedRepository<Self, InMemoryLockManager>
Wrap with the default async lock manager. Pair with
.aggregate::<T>() for per-aggregate serialization over the async
repository surface.Source§fn queued_with<L: LockManager>(
self,
lock_manager: L,
) -> QueuedRepository<Self, L>
fn queued_with<L: LockManager>( self, lock_manager: L, ) -> QueuedRepository<Self, L>
Wrap with a custom async lock manager.