Add asynchronous image decoding support - #879
Conversation
|
Hey, thanks for the PR! This is a problem worth solving, and I've been thinking about it on and off. A few thoughts in no particular order:
I'm also considering a more comprehensive change: making the base Update: thread hops in the case of |
|
Thanks — this matches the trade-off I was aiming for. Your Given the broader next-major direction, would you prefer this PR as an interim non-breaking API—public or behind |
This is probably ideal. I keep forgetting about. I'm open to merging and shipping it with |
Summary
AsyncImageDecodingfor decoders that need to call asynchronous APIsImageDecodingimplementations source-compatibleMotivation
ImageDecodingcurrently exposes only a synchronous entry point, so implementations backed by async APIs have to block a thread with a semaphore. This adds a dedicated async refinement that the pipeline can detect and await without changing existing decoders.Closes #860.
Testing
swift build(all package targets)ImagePipelineDecodingTests: 5 passedImagePipelineTestsandImagePipelineProgressiveDecodingTests: 35 passedThe macOS test runs used Thread Sanitizer disabled because the local Xcode 26.3 test runner could not load its TSan runtime; the shared scheme remains unchanged.