Coroutine Actor obsolete

When I try to use coroutine actor on Android Studio, the ide return warning:

This declaration is experimental and its usage should be marked with '@kotlinx.coroutines.ObsoleteCoroutinesApi' or '@UseExperimental(kotlinx.coroutines.ObsoleteCoroutinesApi::class

What’s the new declaration that are not obsolete?

private val gradeActor = viewModelScope.actor<Int>(CommonPool) {
        for (integer in channel) {
            when (integer) {
                in 0..9 -> computeLowGrade()
                in 10..20 -> computeHighGrade()
                else -> computeIllegalGrade()
            }
        }
    }

There is no replacement for actor, yet.

See also:

1 Like