Using coroutines for asynchronous, concurrent tasks execution with results handling

In this recipe, we are going to explore how to use the coroutines framework in order to run asynchronous operations concurrently, and learn how to handle the results they return properly. We are going to schedule two tasks and run them in the background using two coroutines. The first task is going to be responsible for displaying the progress-bar animation. The second one is going to simulate long-running computations. In the end, we are going to print the results returned by the second task to the console.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.197.167