# Coroutine Actor obsolete

**URL:** <https://discuss.kotlinlang.org/t/coroutine-actor-obsolete/13675>\
**Category:** Support\
**Created:** [July 30, 2019, 1:25pm UTC](https://discuss.kotlinlang.org/t/coroutine-actor-obsolete/13675 "2019-07-30T13:25:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![feliperce](https://avatars.discourse-cdn.com/v4/letter/f/ed655f/32.png) [@feliperce](https://discuss.kotlinlang.org/u/feliperce)\
**Post date:** [July 30, 2019, 1:25pm UTC](https://discuss.kotlinlang.org/t/coroutine-actor-obsolete/13675/1 "2019-07-30T13:25:25Z")

</div>

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()
            }
        }
    }

```

---

<div class="post-metadata">

**Author:** ![fvasco](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/fvasco/32/1961_2.png) [@fvasco](https://discuss.kotlinlang.org/u/fvasco)\
**Post date:** [July 30, 2019, 2:25pm UTC](https://discuss.kotlinlang.org/t/coroutine-actor-obsolete/13675/2 "2019-07-30T14:25:08Z")

</div>

There is no replacement for `actor`, yet.

> <https://github.com/Kotlin/kotlinx.coroutines/issues/776#issuecomment-434599684>
>
> Hi, i'm migrating coroutines from 0.27 to 1.0 but i'm having problems understand…ing how to migrate actors (deprecated).
> 
> The code i use is like this:
> \`\`\`kotlin
> 
> private val processor: SendChannel\<Downloadable\> = actor\<Downloadable\>(capacity = Channel.UNLIMITED) {
> for (download in channel)
> {
> ///....
> }
> }
> \`\`\`
> 
> Thanks

See also:

> <https://github.com/Kotlin/kotlinx.coroutines/issues/87#issuecomment-486177119>
>
> I need to create a complex actor using some private methods to update the intern…al state, but I cannot find any useful base class to implement \`ActorJob\`.
> 
> What is the best practice in such case?
