asTask

fun <T> Deferred<T>.asTask(): Task<T>(source)

Converts this deferred to the instance of Task. If deferred is cancelled then resulting task will be cancelled as well.