June 2018
Intermediate to advanced
310 pages
6h 32m
English
So, we've mentioned a couple of times the following facts:
But how does that actually work?
Let's see an abstract example. How would we compose a user profile?
fun profile(id: String): Profile { val bio = fetchBioOverHttp(id) // takes 1s val picture = fetchPictureFromDB(id) // takes 100ms val friends = fetchFriendsFromDB(id) // takes 500ms return Profile(bio, picture)}
Summing up, our function now takes around 1.6 seconds to complete.
But we've learned about threads. Let's refactor this function ...
Read now
Unlock full access