pub struct CheckpointNotifier { /* private fields */ }Expand description
Publishes model checkpoint notifications to Redis pub/sub.
Used by the backward service after saving a new checkpoint file.
Implementations§
Source§impl CheckpointNotifier
impl CheckpointNotifier
Sourcepub fn new(config: CheckpointNotifierConfig) -> Self
pub fn new(config: CheckpointNotifierConfig) -> Self
Create a new notifier. Does not open a Redis connection yet —
connections are created on each publish call to
keep the notifier lightweight and resilient to transient failures.
Sourcepub async fn publish(&self, notification: &CheckpointNotification) -> Result<()>
pub async fn publish(&self, notification: &CheckpointNotification) -> Result<()>
Publish a checkpoint notification.
If the notifier is disabled or the Redis connection fails, the error is returned but should generally be treated as non-fatal by callers (the checkpoint was already saved to disk).
Auto Trait Implementations§
impl Freeze for CheckpointNotifier
impl RefUnwindSafe for CheckpointNotifier
impl Send for CheckpointNotifier
impl Sync for CheckpointNotifier
impl Unpin for CheckpointNotifier
impl UnsafeUnpin for CheckpointNotifier
impl UnwindSafe for CheckpointNotifier
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