Skip to content

Conversation

@Aldo10012
Copy link
Owner

@Aldo10012 Aldo10012 commented Feb 4, 2026

What's the reason for this PR?

Inside of the different request performing class, we support:

  • async/await & AsyncStream (Swift Concurrency)
  • completion handlers
  • publishers (Combine)

To prevent writing duplicate code, the completion handler method was used as the CORE implementation, and Swift concurrency and combine methods are wrappers of the completion handler method.

Apple recommends that any new async code should be written in Swift Concurrency.

Follow up to:

What's new?

This PR focuses on FileDownloadable. Other classes will be refactored in follow up PRs.

  1. Make swift concurrency method the core implementation handling networking logic,
  2. Make non swift-concurrency methods be wrapper methods.
  3. Replace .downloadFileTask(...) return type from URLSessionDownloadTask to CancellableRequest

@Aldo10012 Aldo10012 changed the title Refactor make swift concurrency core implementation file downloadable Refactor: Make swift concurrency core implementation - FileDownloadable Feb 4, 2026
@Aldo10012 Aldo10012 marked this pull request as ready for review February 4, 2026 02:53
@Aldo10012 Aldo10012 merged commit 141b72c into main Feb 4, 2026
10 of 11 checks passed
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.

2 participants