July 2018
Intermediate to advanced
266 pages
7h 11m
English
So far, we have discussed and implemented suspending functions in one way: as functions that suspend while waiting for the execution of one or more computations to happen. A simple representation of this is as follows:

In this example, getProfile starts its execution and, soon after, it suspends to wait for fetchProfile to execute. Once the response has been processed, getProfile suspends once more, this time to call calculateAge. When calculateAge finishes, the execution of getProfile continues until completion.
In this chapter, we will cover a different scenario: writing functions that are suspended between ...
Read now
Unlock full access