July 2018
Intermediate to advanced
266 pages
7h 11m
English
Deferred extends job in order to make it an asynchronous task that also has a result. Deferred is Kotlin's implementation of what other languages call Futures or Promises. The idea behind it is that a computation will return you an object that will be empty until the asynchronous task completes.
The life cycle of deferred and its states are similar to those of job, so the real differences are in return type—like we saw in the previous chapter—and error handling, as we will cover when we move ahead.
Read now
Unlock full access