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

elizarov

01/19/2018, 4:06 PM
l

louiscad

01/19/2018, 4:23 PM
Why is this marked as fixed? I'm using Kotlin 1.2.20 and kotlinx.coroutines 0.21.2 and I have no
coroutineContext
property available in suspending functions
Hum... I see I can import it manually from intrisics. But why is it not available from IDE autocomplete?
e

elizarov

01/19/2018, 4:32 PM
It is not ready yet. It will move to a “public” package. You can use a workaround with your own
coroutineContext()
function as described there.
l

louiscad

01/19/2018, 4:36 PM
What makes it "not ready"? i just tried my code using it with success, no hacks apart from manual import. Also, the
coroutineContext()
example in the issue also uses a method from the same package:
suspendCoroutineOrReturn
...
I only found it out on the linked GitHub issue (https://github.com/Kotlin/kotlinx.coroutines/issues/114)
e

elizarov

01/19/2018, 6:37 PM
Wrong package & not tested thoroughly yet.
l

louiscad

01/20/2018, 8:46 AM
How can I watch updates on this to know when it's ready to be used? Also, is the suspendCoroutineOrReturn approach from the same intrisic package safer to use?
e

elizarov

01/20/2018, 8:47 AM
intrinsic
package if so unsafe stuff.
Just watch updates on
kotlinx.coroutines
. It will be mentioned in release notes
l

louiscad

01/20/2018, 8:48 AM
So I should use the suspendCoroutine workaround approach for the time being, right?