Skip to content

Add asynchronous image decoding support#879

Open
thliu21 wants to merge 1 commit into
kean:mainfrom
thliu21:codex/860-async-image-decoding
Open

Add asynchronous image decoding support#879
thliu21 wants to merge 1 commit into
kean:mainfrom
thliu21:codex/860-async-image-decoding

Conversation

@thliu21

@thliu21 thliu21 commented Jul 10, 2026

Copy link
Copy Markdown

Summary

  • add AsyncImageDecoding for decoders that need to call asynchronous APIs
  • await async decoders on the existing image decoding queue while preserving error wrapping, cancellation, priority, and signpost behavior
  • keep existing synchronous ImageDecoding implementations source-compatible
  • document async decoder registration and the synchronous cache API limitation
  • add coverage for successful async decoding and error propagation

Motivation

ImageDecoding currently 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 passed
  • ImagePipelineTests and ImagePipelineProgressiveDecodingTests: 35 passed
  • DocC build

The 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.

@thliu21
thliu21 marked this pull request as ready for review July 10, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Asynchronous image decoding

1 participant