pub struct CacheWarmer { /* private fields */ }Expand description
Cache warmer
Implementations§
Source§impl CacheWarmer
impl CacheWarmer
Sourcepub fn new(
cache: Arc<MultiTierCache>,
data_source: Arc<dyn DataSource>,
strategy: Box<dyn WarmingStrategy>,
total_keys: usize,
) -> Self
pub fn new( cache: Arc<MultiTierCache>, data_source: Arc<dyn DataSource>, strategy: Box<dyn WarmingStrategy>, total_keys: usize, ) -> Self
Create new cache warmer
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Set batch size
Sourcepub fn start_background(self: Arc<Self>) -> JoinHandle<Result<()>>
pub fn start_background(self: Arc<Self>) -> JoinHandle<Result<()>>
Start warming in background
Sourcepub async fn progress(&self) -> WarmingProgress
pub async fn progress(&self) -> WarmingProgress
Get current progress
Auto Trait Implementations§
impl Freeze for CacheWarmer
impl !RefUnwindSafe for CacheWarmer
impl Send for CacheWarmer
impl Sync for CacheWarmer
impl Unpin for CacheWarmer
impl UnsafeUnpin for CacheWarmer
impl !UnwindSafe for CacheWarmer
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more