<init>
AbstractCoroutine(
parentContext: CoroutineContext,
active: Boolean = true)
Abstract base class for implementation of coroutines in coroutine builders.
This class implements completion Continuation, Job, and CoroutineScope interfaces. It stores the result of continuation in the state of the job. This coroutine waits for children coroutines to finish before completing and is cancelled through an intermediate cancelling state.
The following methods are available for override:
- onStart is invoked when coroutine is create in not active state and is started.
- onCancellation is invoked as soon as coroutine is cancelled (becomes cancelling) or when it completes for any reason.
- onCompleted is invoked when coroutine completes with a value.
- onCompletedExceptionally in invoked when coroutines completes with exception.
Parameters
parentContext
- context of the parent coroutine.
active
- when true
(by default) coroutine is created in active state, when false
in new state.
See Job for details.