https://kotlinlang.org logo
Title
v

vineethraj49

03/25/2020, 5:46 PM
what's a good naming convention if I'm writing a suspending implementation of an existing method?
z

zak.taccardi

03/25/2020, 5:50 PM
I don’t know what a job handle is, but
CoroutineScope
is likely what you are looking for here
2
if the
CoroutineScope
used to launch a coroutine has been cancelled, the coroutine will not run (or stop running if it already is)
more specifically, it is the
Job
within the
CoroutineScope
that you are looking for.
scope.coroutineContext[Job]!!
is how you access it
v

vineethraj49

03/25/2020, 6:01 PM
i think you’re referring to the below post ;) also
conn
here is a
org.skife.jdbi.v2.Handle
z

zak.taccardi

03/25/2020, 6:01 PM
oh, wups
z

Zach Klippenstein (he/him) [MOD]

03/25/2020, 7:19 PM
await*
is pretty common.
suspend fun awaitFoo() = withContext(IO) { foo() }
1
l

louiscad

03/25/2020, 7:59 PM
@zak.taccardi Wrong thread? I think you can delete the messages from this one.
👍 2