https://kotlinlang.org logo
#ktor
Title
# ktor
g

Gabriel Feo

03/25/2020, 4:31 PM
[Resolved] I'm getting a "Not started" error trying to launch a coroutine inside a Ktor call. Anyone knows what this is about?
A bit more context This is my route definition:
And this line 21 of
DocumentJoiner
, where I'm trying to launch the coroutine that causes the error
c

Casey Brooks

03/25/2020, 4:43 PM
It doesn’t look like you’re ever
await()
-ing the async job. That probably means it’s running right to
call.respond()
synchronously before the
async
job can be started (
async
is not suspending, it’s called on a
CoroutineScope
receiver and returns immediately)
g

Gabriel Feo

03/25/2020, 4:53 PM
You're right, I forgot to await 🤦🏻
ApplicationCall.respond
receives
Any
. It'd take me ages to notice that was missing, thank you!
2 Views