https://kotlinlang.org logo
#coroutines
Title
# coroutines
v

voddan

07/28/2016, 2:58 PM
@orangy: continuing our discussion from yesterday: I think I 've gotten my head around coroutines (this helped: https://github.com/Kotlin/kotlin-coroutines/tree/master/examples) My problem with the current design was the implicit last parameter of a suspending function, which makes a call of such a function something not-regular (the call side does not match the declaration side) AFAIU, we need such a parameter simply because there is nowhere else to pass it. I made an observation that there is always one continuation on on controller. So a cool solution would be to pass the continuation into the controller. That would solve the problem. Unfortunately the continuation is created after the controller (to save this cool syntax with an extension lambda`yield(coroutine c: Controller.() -> Continuation<Unit>`).