Each suspend function has exactly one Continuation...
# coroutines
a
Each suspend function has exactly one Continuation object, right or wrong ?
s
It has a (hidden)
Continuation
parameter.
d
Multiple
Continuation
objects could also be created within the suspend function.
a
@Dominaezzz when would that happen ? @streetsofboston yeah i mean the compiler adds one Conitnuation object per suspend function (originaly i thought it is one Continuation object per coroutine)
d
When a suspend function is called within it.
s
Each suspension point is associated with one Continuation. Basically, the Continuation carries the result (good result or exception) and a ‘pointer/label’ that determines where the suspension point must resume.
1
a
@streetsofboston thx for confirming. @Dominaezzz i think when a supsend function is called within it, it gets the coninuation object from the calling function passed and the called function again has its own continuation object it can potentially pass on to other suspedn functions