Anko: I wanna know what's the difference between anko.async and anko.doAsync?

Created on 21 Apr 2018  路  2Comments  路  Source: Kotlin/anko

When I do import anko.async, AS show error. while import anko.doAsync looks fine, with anko version 0.10.4.
what's the difference between anko.async and anko.doAsync?

question

Most helpful comment

IIRC, doAsync was called async previously. It was renamed as to not conflict with the _kotlinx.coroutines_ function by the same name. So Anko's async is probably deprecated in favor of doAsync, but not removed entirely because of backward compatibility.

All 2 comments

There is no async in anko, it is part of coroutines library and used to create new coroutine. doAsync is part of anko-commons and is used to execute task on background thread.

IIRC, doAsync was called async previously. It was renamed as to not conflict with the _kotlinx.coroutines_ function by the same name. So Anko's async is probably deprecated in favor of doAsync, but not removed entirely because of backward compatibility.

Was this page helpful?
0 / 5 - 0 ratings