Expand description
§Model Checkpoint Notification
Shared types for notifying downstream services (e.g. Forward) when the Backward service saves a new model checkpoint.
§Redis Channel
Notifications are published on fks:{instance_id}:model_checkpoints as
JSON-serialised CheckpointNotification messages.
§Usage
ⓘ
use janus_core::checkpoint_notify::{CheckpointNotification, checkpoint_channel};
// Publisher (backward service)
let channel = checkpoint_channel("default");
let notification = CheckpointNotification::new(
"checkpoints/backward/latest_model.bin",
"lstm_dqn_v1",
);
let json = serde_json::to_string(¬ification).unwrap();
// redis.publish(channel, json).await?;
// Subscriber (forward service)
let channel = checkpoint_channel("default");
// redis.subscribe(channel).await?;
// ... on message:
let notification: CheckpointNotification = serde_json::from_str(&payload)?;
println!("New checkpoint: {}", notification.model_path);Structs§
- Checkpoint
Notification - A notification emitted by the backward service when a new model checkpoint has been saved to disk.
- Checkpoint
Notifier - Publishes model checkpoint notifications to Redis pub/sub.
- Checkpoint
Notifier Config - Configuration for the checkpoint notifier.
Functions§
- checkpoint_
channel - Returns the Redis pub/sub channel name used for model checkpoint notifications for the given instance.