Progress Tracking
The Progress Tracking system allows you to monitor job execution, observe pipelines, and react to lifecycle events for long-running media tasks.
Core Concepts
EventEmitter-Based
Progress is tracked via events for real-time updates
Granular Tracking
Progress is emitted per job and per pipeline
Consistent Contract
Progress payload follows a standardized structure
ProgressInfo Interface
Progress payload follows a consistent structure:
1234567
Tracking Job Progress
Each Job instance exposes an event emitter for progress and completion monitoring:
1234567891011121314151617181920212223242526272829
Job Events
Tracking Pipeline Progress
Pipelines aggregate multiple jobs and allow global monitoring:
12345678910111213141516171819202122232425262728293031
Pipeline Events
Real-time Progress Example
Live Progress Updates
Best Practices
Always Attach Error Listeners
Avoid uncaught promise rejections by handling all error events
Use Appropriate Progress Data
Use progress.percent for UI bars; eta for time estimation
Pipeline-Level Tracking
For multi-step pipelines, use pipeline progress over manual aggregation
Consider Granularity
Jobs emit granular progress; pipelines emit aggregated progress
Key Guidelines:
- Always attach error listeners to avoid uncaught promise rejections
- Use
progress.percent
for UI progress bars;eta
for time estimation - For multi-step pipelines, consider using pipeline-level progress rather than manual aggregation
- Jobs emit more granular progress; pipelines emit aggregated progress
Advanced Progress Handling
12345678910111213141516171819202122232425262728293031
Master Error Handling Next
Now that you can track progress effectively, learn how to handle errors gracefully and build robust media processing applications with MediaX.