Coroutines with Kotlin represents one of the most interesting and fasinating challenges in the software engineering world. It’s an opportunity to implement complex concurrent tasks in an elegant and performant way. These tutorials gives the opportunity to learn the basic concepts about multithreading and how concurrent programming can be simplified using Kotlin and Coroutines.
Kotlin is a general purpose, open source, statically typed “pragmatic” programming language for the JVM that combines object-oriented and functional programming features. It originated at JetBrains, the company that drives IntelliJ IDEA, and has been open source since 2012.
At Google I/O 2017 Kotin was officially supported by Google as the main language for developing Android applications. It is a language focused on interoperability, safety, clarity, and tooling support.
It is also important to mention it’s multiplatform support with JavaScript (ECMAScript 5.1) and native code (using LLVM).
Asynchronous programming is often tedious and error-prone. The extensive usage of callbacks makes the code hard to read, debug and test. Coroutines define a different paradigm which introduces the concept of suspending functions. Coroutines generalize subroutines for non-preemptive multitasking, by allowing execution to be suspended and resumed. This way it's possible to write asynchronous code as if it were synchronous. Coroutines are a recent solution in Kotlin and Android environment for writing concurrent and asynchronous code.