fun <T> (suspend () -> T).createCoroutineUnintercepted( completion: Continuation<T> ): Continuation<Unit>
Creates unintercepted coroutine without receiver and with result type T. This function creates a new, fresh instance of suspendable computation every time it is invoked.
To start executing the created coroutine, invoke resume(Unit)
on the returned Continuation instance. The completion continuation is invoked when coroutine completes with result or exception.
This function returns unintercepted continuation. Invocation of resume(Unit)
starts coroutine immediately in the invoker's call stack without going through the ContinuationInterceptor that might be present in the completion's CoroutineContext. It is the invoker's responsibility to ensure that a proper invocation context is established. Note that completion of this function may get invoked in an arbitrary context.
Continuation.intercepted can be used to acquire the intercepted continuation. Invocation of resume(Unit)
on intercepted continuation guarantees that execution of both the coroutine and completion happens in the invocation context established by ContinuationInterceptor.
Repeated invocation of any resume function on the resulting continuation corrupts the state machine of the coroutine and may result in arbitrary behaviour or exception.
fun <R, T> (suspend R.() -> T).createCoroutineUnintercepted( receiver: R, completion: Continuation<T> ): Continuation<Unit>
Creates unintercepted coroutine with receiver type R and result type T. This function creates a new, fresh instance of suspendable computation every time it is invoked.
To start executing the created coroutine, invoke resume(Unit)
on the returned Continuation instance. The completion continuation is invoked when coroutine completes with result or exception.
This function returns unintercepted continuation. Invocation of resume(Unit)
starts coroutine immediately in the invoker's call stack without going through the ContinuationInterceptor that might be present in the completion's CoroutineContext. It is the invoker's responsibility to ensure that a proper invocation context is established. Note that completion of this function may get invoked in an arbitrary context.
Continuation.intercepted can be used to acquire the intercepted continuation. Invocation of resume(Unit)
on intercepted continuation guarantees that execution of both the coroutine and completion happens in the invocation context established by ContinuationInterceptor.
Repeated invocation of any resume function on the resulting continuation corrupts the state machine of the coroutine and may result in arbitrary behaviour or exception.
© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines.intrinsics/create-coroutine-unintercepted.html