Multi-worker encoding and srcset generation
- Dominant language
- Rust
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Support running multiple encode operations in parallel across Web Workers, and add a srcset generator for responsive image output.
## Multi-worker encoding
Currently the demo uses a single worker for all pipeline operations. For export, we could spawn additional workers to:
- Encode the same image in multiple formats simultaneously (JPEG + WebP + AVIF)
- Encode at multiple resolutions for srcset output
- Allow the user to continue editing while an export runs in the background
### Implementation sketch
- Worker pool: 2-4 workers, each with its own WASM Editor instance
- Primary worker handles interactive rendering (overview + detail)
- Export workers handle full-res encode jobs
- Job queue with priority (interactive > export)
- Cancel support via enough::Stop per worker
## Srcset generator
Generate a complete srcset with multiple widths and formats:
```
image-400w.webp 400w, image-800w.webp 800w, image-1600w.webp 1600w
```
- User picks target widths (or presets: thumbnail, mobile, desktop, retina)
- Each width × format combination is an encode job
- Progress bar shows overall completion
- Output as a zip or individual downloads
## Related
- enough::Stop cancellation already wired through Session
- Current single-worker architecture in demo/worker.js
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the current single-worker architecture in demo/worker.js and trace how Session already wires enough::Stop cancellation. Define the worker-pool and job-queue behavior for interactive and export work, then specify how width and format combinations produce srcset output. Done means parallel encoding, cancellation, progress reporting, and the requested download outputs work together.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, rust, wasm
- Domain
- performance, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100