Expand description
Global decode progress tracking.
Uses atomics so it is safe to call from rayon worker threads.
When the wasm feature is enabled, an optional JS callback is invoked
on each advance() to drive a real-time progress bar via Web Worker
postMessage.
Functionsยง
- advance
- Advance progress by one step and notify the callback (if set).
Step is capped at total to avoid displaying values like โ84/15โ.
When total is 0 (indeterminate), step still advances freely so that
the UI can show activity;
init()with the real total will follow. - advance_
by - Advance progress by
nsteps. Convenience wrapper that callsadvancein a loop. - cancel
- Request cancellation of the current decode operation.
- check_
cancelled - Check for cancellation and return an error if requested.
- finish
- Mark progress as complete (step = total) and notify.
- get
- Read the current (step, total) progress.
- init
- Reset progress to 0 and set the total step count. Also resets the cancellation flag so a fresh decode starts clean.
- is_
cancelled - Returns
trueif cancellation has been requested. - set_
total - Set (or update) the total without resetting the current step. Used by pipeline code that discovers the real total mid-flight (e.g. after counting delta candidates).