JetForMe
(Rick M)
1
After a half-hour of googling, I haven't been able to find a good answer. Is there any way to make an SPM project with a main.swift file entry point execute in a concurrent/async context? I can do it with something like this:
AppMain.swift:
@main
struct
AppMain
{
static
func
main()
async
throws
{
try await someTask()
}
}
But I'd like to do it like this:
main.swift:
try await someTask()
(Swift doesn't allow the presence of @main and a main.swift in the target.)
MarSe32m
(Sebastian Toivonen)
2
Right now this isn't possible but the proposal to enable this is under active review: SE-0343: Concurrency in Top-level Code
3 Likes
JetForMe
(Rick M)
3
Thanks. Looking at that again, I remember reading it before. I love the desired implementation ("just works"). Looking forward to it.