Skip to main content

run_encoder_worker_blocking

Function run_encoder_worker_blocking 

Source
pub fn run_encoder_worker_blocking(
    cfg: EncoderWorkerConfig,
    queue: Arc<SegmentChunkQueue>,
    rt: Handle,
    shared_frames_encoded: Arc<AtomicU64>,
    progress_tx: Sender<u64>,
) -> Result<WorkerOutput>
Expand description

Run the encoder loop until the chunk queue is closed and drained. Designed to be wrapped in tokio::task::spawn_blocking.

progress_tx receives the shared cumulative frames_encoded_total after every encoded frame; the caller’s drain task fires wire events from this stream. Multiple workers bump the same counter, so the progress reading stays monotonic across worker handoffs.