# Replace Anko's doAsync, uiThread with kotlinx-coroutines-core lib

**URL:** <https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383>\
**Category:** Android\
**Created:** [March 10, 2017, 8:08pm UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383 "2017-03-10T20:08:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![edgeone](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@edgeone](https://discuss.kotlinlang.org/u/edgeone)\
**Post date:** [March 10, 2017, 8:08pm UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/1 "2017-03-10T20:08:14Z")

</div>

Hello,  
is it possible to replace Anko’s doAsync and uiTread with something from kotlinx-coroutines-core lib?

---

<div class="post-metadata">

**Author:** ![elizarov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/elizarov/32/2164_2.png) [@elizarov](https://discuss.kotlinlang.org/u/elizarov)\
**Post date:** [March 10, 2017, 9:48pm UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/2 "2017-03-10T21:48:55Z")

</div>

Not yet, but the next release of `kotlinx.coroutines` project will come out with a separate `kotlin-coroutines-android` module. That will provide a replacement you are looking for.

---

<div class="post-metadata">

**Author:** ![edgeone](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@edgeone](https://discuss.kotlinlang.org/u/edgeone)\
**Post date:** [March 11, 2017, 7:55am UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/3 "2017-03-11T07:55:44Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![edgeone](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@edgeone](https://discuss.kotlinlang.org/u/edgeone)\
**Post date:** [March 11, 2017, 11:37am UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/4 "2017-03-11T11:37:00Z")

</div>

could you tell, please, when the next release of kotlinx.coroutines will come?

---

<div class="post-metadata">

**Author:** ![elizarov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/elizarov/32/2164_2.png) [@elizarov](https://discuss.kotlinlang.org/u/elizarov)\
**Post date:** [March 12, 2017, 6:52pm UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/5 "2017-03-12T18:52:07Z")

</div>

Somewhere this week.

---

<div class="post-metadata">

**Author:** ![edgeone](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@edgeone](https://discuss.kotlinlang.org/u/edgeone)\
**Post date:** [March 12, 2017, 7:14pm UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/6 "2017-03-12T19:14:42Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![elizarov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/elizarov/32/2164_2.png) [@elizarov](https://discuss.kotlinlang.org/u/elizarov)\
**Post date:** [March 14, 2017, 8:57pm UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/7 "2017-03-14T20:57:43Z")

</div>

Released. A guide on UI programming with coroutines is here: [kotlinx.coroutines/coroutines-guide-ui.md at master · Kotlin/kotlinx.coroutines · GitHub](https://github.com/Kotlin/kotlinx.coroutines/blob/master/ui/coroutines-guide-ui.md)

---

<div class="post-metadata">

**Author:** ![edgeone](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@edgeone](https://discuss.kotlinlang.org/u/edgeone)\
**Post date:** [March 14, 2017, 9:12pm UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/8 "2017-03-14T21:12:38Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![edgeone](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@edgeone](https://discuss.kotlinlang.org/u/edgeone)\
**Post date:** [March 14, 2017, 9:28pm UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/9 "2017-03-14T21:28:04Z")

</div>

one thing, but offtopic: it would be nice to see examples in javadoc of kotlin libraries(stdlib, etc.). For example, the page [https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-job/index.html](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-job/index.html) has been written good, but lacks examples of code; it would be useful to see the sections “Examples” in the docs.

---

<div class="post-metadata">

**Author:** ![elizarov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/elizarov/32/2164_2.png) [@elizarov](https://discuss.kotlinlang.org/u/elizarov)\
**Post date:** [March 15, 2017, 7:12am UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/10 "2017-03-15T07:12:48Z")

</div>

I have not figured out how to provide nice self-contained examples right there. Most of the functions are not independent and are really used in the context of other functions. There are lots of the examples in the guide: [kotlinx.coroutines/coroutines-guide.md at master · Kotlin/kotlinx.coroutines · GitHub](https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md) As you can see, they are all somewhat on the big side to be included directly into the documentation pages.

---

<div class="post-metadata">

**Author:** ![edgeone](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@edgeone](https://discuss.kotlinlang.org/u/edgeone)\
**Post date:** [March 15, 2017, 7:30am UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/11 "2017-03-15T07:30:07Z")

</div>

maybe in javadoc in section “Examples” put links on the examples?

---

<div class="post-metadata">

**Author:** ![elizarov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/elizarov/32/2164_2.png) [@elizarov](https://discuss.kotlinlang.org/u/elizarov)\
**Post date:** [March 15, 2017, 7:58am UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/12 "2017-03-15T07:58:49Z")

</div>

Great idea, thank you. I can automate that by adding back-references from the reference documentation on functions and classes to the guide sections that mention (link to) them.

---

<div class="post-metadata">

**Author:** ![edgeone](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@edgeone](https://discuss.kotlinlang.org/u/edgeone)\
**Post date:** [March 15, 2017, 8:03am UTC](https://discuss.kotlinlang.org/t/replace-ankos-doasync-uithread-with-kotlinx-coroutines-core-lib/2383/13 "2017-03-15T08:03:50Z")

</div>

Thank you too! and one more thing, by the way: Changelog in javadocs for every class\method\function would be also useful, if it is possible to add; what i mean, for example, is here: [PHP: json\_encode - Manual](http://php.net/manual/en/function.json-encode.php)
