Skip to main content

Module progress

Module progress 

Source
Expand description

Job progress reporting.

Every transcode job reports progress through a ProgressSink — a small trait that receives a uniform RungProgress struct (status, percentage, frame/segment/byte counters) for each rung as the job runs, plus coarse JobEvents for job-level lifecycle.

The sink methods are synchronous but are called as the job progresses (i.e. asynchronously with respect to completion). To bridge into async code — e.g. forward progress to a websocket/SQS reporter — wrap a tokio::sync::mpsc::Sender with channel_sink, or implement ProgressSink and try_send into your own channel.

Structs§

ChannelSink
A sink that forwards every RungProgress into a Tokio mpsc channel, turning the callback into an async stream the caller can .recv().await. Sends are non-blocking (try_send); if the channel is full or closed the update is dropped (progress is advisory, never load-bearing).
FnSink
Wraps a closure as a ProgressSink.
NullSink
A sink that drops every update. Useful as a default.
RungProgress
A uniform progress update for one rung. Emitted repeatedly over the life of the job. Consumers can render a per-rung progress bar straight from these fields without knowing anything about the output mode.

Enums§

JobEvent
Job-level lifecycle events, independent of any single rung.
RungStatus
Lifecycle status of a single rung (one rendition of the ABR ladder).

Traits§

ProgressSink
Receiver for job progress. Implement to consume updates; or use channel_sink / fn_sink for the common cases.

Functions§

channel_sink
Convenience: wrap an mpsc sender as an Arc<dyn ProgressSink>.
fn_sink
Build a ProgressSink from a closure: fn_sink(|p| println!("{}", p.percent)).