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

Application.run() should be noasync #2937

Closed
weissi opened this issue Jan 18, 2023 · 2 comments · Fixed by #3114
Closed

Application.run() should be noasync #2937

weissi opened this issue Jan 18, 2023 · 2 comments · Fixed by #3114

Comments

@weissi
Copy link
Contributor

weissi commented Jan 18, 2023

public func run() throws {

Application.run() blocks the calling thread. That's fine but not on the Swift Concurrency thread pools. It should therefore be marked @available(*, noasync).

Additionally, it might be worthwhile to provide an public func run() async which awaits the shutdown.

@Joannis
Copy link
Member

Joannis commented Jan 19, 2023

I believe I have the second idea already in a PR, I might've forgotten to submit it though. I forgot about noasync, let me do that!

@Joannis
Copy link
Member

Joannis commented Jan 19, 2023

I want to add that it's become a notorious issue in func main() async throws

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants