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
Async functions in Xcode 14.3 are bugged #2993
Comments
If you don't block the main thread inside the @main function by replacing try app.start()
try await app.running?.onStop.get() |
The problem, most likely, is that your |
Note that even if this wasn't causing problems on macOS now, this would've caused you headaches on single-core Linux machines still. |
Got it. FYI this code was derived from the 2022 WWDC server side swift video, so I expect others to run into this issue too. |
just ran into this issue 😅 |
See the current template's entrypoint for how to configure it correctly until we add an async version on |
Thank you. I found a workaround. |
Closing this as this is fixed with the new entry point |
Describe the bug
Routes that use
async
functions fail to return responses:To Reproduce
MyServer
with Xcode 14.3Package.swift
to the following:MyServer.swift
file within Sources/MyServer, add the following code:The first curl returns "Hello".
The second curl hangs on Terminal.
Running the same two curl commands should work fine.
Environment
Additional context
I terminated the second curl by ctrl + c. I then ran
lsof -i :8080
which yielded the following output:The text was updated successfully, but these errors were encountered: