ClosureBase

The ClosureBase<T> class

A coroutine closure that has been autogenerated by the compiler.

Maintains the state of the coroutine function across suspensions. This class implements CoroutineContinuation, as it may receive disparate types to calls of its resume method during the suspension and resumption of the coroutine's execution. Every time the coroutine is resumed normally, the value will be passed in to the continuation, and then along to the state machine.

The doResume method has the same contract as the coroutine: it either hangs, returns a coroutine result, throws, or returns a 'suspended' indicator.

Interface synopsis

class ClosureBase implements CoroutineContinuation {...}