July 2018
Intermediate to advanced
266 pages
7h 11m
English
Recently, I was faced with a relatively simple programming task: querying 10 content indexers for a specific keyword, and then displaying the results of the search to the user. A valid first approach would have been to launch a coroutine for each content indexer, returning Deferred<List<ResultDto>>, and upon completion of all of the coroutines, merging the results and sending them to the UI.
A representation of this approach could look like this:

In this example, search() starts three coroutines, giving them the keywords to search. Each coroutine will fetch the results from the indexer. Upon completion of the three ...
Read now
Unlock full access