With a `suspend () -> Unit`, you can create a `...
# coroutines
h
With a
suspend () -> Unit
, you can create a
Continuation
by calling
createCoroutine()
. How can you create a
CancelableContinuation
?
s
You cannot afaik. It's private to KoltinX Coroutines.
h
Yeah, but this starts the coroutine, I would like to create and start it later
s
That is also all internal machinery, but hidden away more than this. You can follow these implementations to see where they lead, but it leads to more
internal
and
@InternalCoroutinesApi
based code.
What is your use-case for doing this?
e
launch(start = CoroutineStart.LAZY) { ... }
will not run the code until the resulting
Job
is `.start()`ed
☝️ 1
k
Maybe you’re looking for suspendCancellableCoroutine ?