frankelot
08/27/2021, 7:50 AMsuspendingContinuation<OriginalReturnType>OriginalReturnTypeContinuationrequestTokencreatePostsuspend fun requestTokenrequestToken(Continuation<Token>)suspend fun createPostcreatePost(Continution<Post>)smlouiscad
08/27/2021, 8:14 AMfrankelot
08/27/2021, 8:19 AMfrankelot
08/27/2021, 8:20 AMsuspendingfrankelot
08/27/2021, 8:21 AMlouiscad
08/27/2021, 8:22 AMfrankelot
08/27/2021, 8:24 AMreturncontinuation.resumeWith(...)frankelot
08/27/2021, 8:25 AMresumeWithfrankelot
08/27/2021, 8:26 AMlouiscad
08/27/2021, 8:31 AMfrankelot
08/27/2021, 8:37 AMlouiscad
08/27/2021, 8:39 AMResultlouiscad
08/27/2021, 8:39 AMfrankelot
08/27/2021, 8:42 AMfrankelot
08/27/2021, 8:42 AMraulraja
08/27/2021, 2:14 PMdecompile javafrankelot
08/27/2021, 2:18 PMfrankelot
08/27/2021, 2:18 PMsuspend fun Bar(): Int {
        delay(100)
        return 1
    }frankelot
08/27/2021, 2:19 PMpublic final Object Bar(@NotNull Continuation var1) {
   Object $continuation;
   label20: {
      // ... ommited code ...
      $continuation = new ContinuationImpl(var1) {
         // $FF: synthetic field
         Object result;
         int label;
         @Nullable
         public final Object invokeSuspend(@NotNull Object $result) {
            this.result = $result;
            this.label |= Integer.MIN_VALUE;
            return Foo.this.Bar(this);
         }
      };
   }
   ...       // ... ommited code (state machine) ... ....
   return Boxing.boxInt(1);
}frankelot
08/27/2021, 2:20 PMContinuationImplfrankelot
08/27/2021, 2:21 PMreturnsuspending functionfrankelot
08/27/2021, 2:22 PMObjectSUSPENDINGraulraja
08/27/2021, 2:27 PMsuspend foo(): Unit
suspend foo2(): Unit // this one calls suspendCoroutine { resumeWith(Unit) }raulraja
08/27/2021, 2:30 PMthrowOnFailuregetOrThrowfrankelot
08/27/2021, 2:33 PMfrankelot
08/27/2021, 2:33 PMfrankelot
08/27/2021, 2:35 PMlaunch { foo() }ephemient
08/28/2021, 6:38 AMephemient
08/28/2021, 6:40 AMraulraja
08/28/2021, 7:19 AMMatthias Geisler
08/28/2021, 9:52 AMIlmir Usmanov [JB]
08/28/2021, 3:17 PMsmreturnreturnsuspending functionfrankelot
08/29/2021, 7:13 PMBaseContinuationImpl#resumeWithfrankelot
08/29/2021, 7:15 PMstackoverflowsfrankelot
08/29/2021, 7:21 PM