pub struct Singleflight<T> { /* private fields */ }Expand description
Singleflight prevents the “Cache Stampede” effect (Dogpile effect). If multiple requests for the same key arrive simultaneously, only the first one executes the future. The others wait and receive the result of the first one.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Singleflight<T>
impl<T> !UnwindSafe for Singleflight<T>
impl<T> Freeze for Singleflight<T>
impl<T> Send for Singleflight<T>
impl<T> Sync for Singleflight<T>
impl<T> Unpin for Singleflight<T>
impl<T> UnsafeUnpin for Singleflight<T>
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