pub(crate) struct ChannelLogger {
pub(crate) handle: JoinHandle<()>,
pub(crate) stop_tx: Option<Sender<()>>,
pub(crate) calibration_tx: Sender<CalibrationSpec>,
pub(crate) calibration: CalibrationSpec,
pub(crate) subject: String,
pub(crate) stream_name: String,
pub(crate) consumer_name: String,
pub(crate) asset: u32,
pub(crate) rotate_secs: u64,
}Expand description
Runtime state for one active channel consumer and writer task.
The archiver keeps this state so KV updates can stop removed channels, rotate calibration metadata, or respawn consumers when subject identity changes. The identity fields are the values the task was started with.
Fields§
§handle: JoinHandle<()>Handle of the writer task; main restarts the channel when it has finished.
stop_tx: Option<Sender<()>>Sends the graceful stop request; taken by Self::stop.
calibration_tx: Sender<CalibrationSpec>Sends calibration updates to the writer task.
calibration: CalibrationSpecCalibration last sent to the writer task.
subject: StringJetStream subject the consumer filters on.
stream_name: StringJetStream stream the consumer belongs to.
consumer_name: StringDurable consumer name.
asset: u32Asset number used in output paths.
rotate_secs: u64Rotation window length in seconds.
Implementations§
Source§impl ChannelLogger
impl ChannelLogger
Sourcepub(crate) async fn stop(self)
pub(crate) async fn stop(self)
Requests an orderly writer shutdown and waits for the task to finish.
On a graceful stop the task closes its open file (writing the Parquet footer) and acks the messages in it before it ends. If the task has already ended, the stop request is ignored and only the join happens. A join error (for example a panic in the task) is logged.