Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for async/await. #78

Merged
merged 14 commits into from
Jul 18, 2022
Merged

Conversation

DenTelezhkin
Copy link
Member

Also add methods to download API for simplifying creation of DownloadAPIRequest objects.

@DenTelezhkin DenTelezhkin marked this pull request as draft July 9, 2021 13:32
@codecov
Copy link

codecov bot commented Jul 9, 2021

Codecov Report

Merging #78 (9261545) into main (422b66b) will increase coverage by 0.21%.
The diff coverage is 60.00%.

❗ Current head 9261545 differs from pull request most recent head 1cd323c. Consider uploading reports for the commit 1cd323c to get more accurate results

@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
+ Coverage   72.77%   72.98%   +0.21%     
==========================================
  Files          14       15       +1     
  Lines         786      944     +158     
  Branches      362      439      +77     
==========================================
+ Hits          572      689     +117     
- Misses        206      242      +36     
- Partials        8       13       +5     

@kiritokatklian
Copy link

@DenTelezhkin what's the status on Swift Concurrency support for TRON? Will it eventually be supported?

Btw, thanks for your work on this package. It makes working with Alamofire so much more bearable.

@DenTelezhkin
Copy link
Member Author

Hi, @kiritokatklian! Thanks for asking. Current PR was a proof of concept I made to see how Structured Concurrency can work in TRON package, however I did not feel confident enough shipping this, as I did not actually use Structured Concurrency in any project yet. So I left this PR hanging (while it seems to be working perfectly fine) until now.

Now that i know that there is some interest in community in supporting this, I will definitely prioritize this more. Currently unresolved questions for me are about cancellation properly integrated with Structured Concurrency and usage of Task API (which should be updated to newer syntax).

Alamofire approach to those API's is creating DataTask, and returning 3 kinds of possible results - response, result, value, which seems pretty reasonable to me. It's possible that in order to ship this feature in TRON I will mimic this behavior on TRON side as well. https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#using-alamofire-with-swift-concurrency

If you have any input on how those API should be structured, would love any feedback as well, since my knowledge of Concurrency is limited by WWDC sessions, and not real world usage, unfortunately (for now, at least :) ).

@DenTelezhkin DenTelezhkin force-pushed the feature/structured-concurrency branch from 9baa36f to 8330665 Compare July 14, 2022 12:47
@DenTelezhkin DenTelezhkin marked this pull request as ready for review July 18, 2022 15:41
@DenTelezhkin DenTelezhkin merged commit 42d6ec4 into main Jul 18, 2022
@DenTelezhkin DenTelezhkin deleted the feature/structured-concurrency branch July 18, 2022 15:42
@DenTelezhkin
Copy link
Member Author

@kiritokatklian I've released support for Swift Concurrency in 5.5.0 beta release. If you have any issues / suggestions, please let me know.

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