Expand description
Per-key asynchronous mutual exclusion with automatic entry cleanup.
Each key maps to a Tokio mutex shared by its current contenders. The last contender to release its claim removes the entry, whether it held the mutex or was canceled while waiting for it.
Re-exportsยง
use std::fmt::Debug;๐use std::fmt::Debug;๐use std::hash::Hash;๐use std::hash::Hash;๐use std::sync::Arc;๐use std::sync::TryLockError::WouldBlock;๐use futures::StreamExt;๐use itertools::Itertools;๐use tokio::sync::OwnedMutexGuard as Omg;๐use crate::Result;๐use crate::err;๐use crate::utils::IterStream;๐
Structsยง
- Guard
- Keeps a keyed mutex locked until the guard is dropped.
- Mutex
Map - Provides independent asynchronous mutexes keyed by owned values.