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

Replace detached tasks with Task.dispatch(on:) #201

Merged
merged 5 commits into from Sep 21, 2022

Conversation

pixlwave
Copy link
Contributor

@pixlwave pixlwave commented Sep 21, 2022

This should stop us from ever overwhelming the workers with too many detached tasks that don't suspend.

All Task.detached that didn't have an await and so were presumably blocking, have been replaced with continuations that dispatch onto the specified queue. A future tweak could be to make separate queues or to provide a QoS to the global queue.

@github-actions
Copy link

github-actions bot commented Sep 21, 2022

Warnings
⚠️ Some of the commits are missing ticket numbers. Please consinder using them for better tracking.

Generated by 🚫 Danger Swift against 69e0b9e

@pixlwave pixlwave changed the title Doug/dispatched tasks Replace detached tasks with a DispatchQueue.awaitable option. Sep 21, 2022
@pixlwave pixlwave requested review from a team and ismailgulek and removed request for a team September 21, 2022 14:26
Copy link
Contributor

@ismailgulek ismailgulek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tiny question inline, otherwise LGTM!

ElementX/Sources/Other/Extensions/DispatchQueue.swift Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Sep 21, 2022

📱 Scan the QR code below to install the build for this PR.
🔒 This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.

QR code

If you can't scan the QR code you can install the build via this link: https://i.diawi.com/RX2Ynj

@codecov
Copy link

codecov bot commented Sep 21, 2022

Codecov Report

Base: 11.91% // Head: 11.97% // Increases project coverage by +0.06% 🎉

Coverage data is based on head (69e0b9e) compared to base (a88491b).
Patch coverage: 5.55% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #201      +/-   ##
===========================================
+ Coverage    11.91%   11.97%   +0.06%     
===========================================
  Files          203      208       +5     
  Lines        13565    14146     +581     
  Branches      6616     6844     +228     
===========================================
+ Hits          1616     1694      +78     
- Misses       11909    12412     +503     
  Partials        40       40              
Impacted Files Coverage Δ
...Kit/Sources/Buttons/ElementActionButtonStyle.swift 0.00% <0.00%> (ø)
...it/Sources/Buttons/ElementCapsuleButtonStyle.swift 0.00% <0.00%> (ø)
ElementX/Sources/AppCoordinator.swift 0.00% <0.00%> (ø)
ElementX/Sources/AppCoordinatorStateMachine.swift 0.00% <ø> (ø)
...mentX/Sources/Generated/Strings+Untranslated.swift 50.00% <ø> (ø)
ElementX/Sources/Other/Extensions/Collection.swift 0.00% <0.00%> (ø)
ElementX/Sources/Other/Extensions/String.swift 0.00% <0.00%> (ø)
...tX/Sources/Other/SwiftUI/Views/RoundedCorner.swift 0.00% <0.00%> (ø)
...ens/Authentication/AuthenticationCoordinator.swift 0.00% <ø> (ø)
.../Authentication/LoginScreen/LoginCoordinator.swift 0.00% <ø> (ø)
... and 75 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sonarcloud
Copy link

sonarcloud bot commented Sep 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@pixlwave pixlwave changed the title Replace detached tasks with a DispatchQueue.awaitable option. Replace detached tasks with a Task.dispatch(on:). Sep 21, 2022
@pixlwave pixlwave changed the title Replace detached tasks with a Task.dispatch(on:). Replace detached tasks with Task.dispatch(on:) Sep 21, 2022
@pixlwave pixlwave merged commit 8462862 into develop Sep 21, 2022
@pixlwave pixlwave deleted the doug/dispatched-tasks branch September 21, 2022 16:50
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.

None yet

2 participants