July 2018
Intermediate to advanced
266 pages
7h 11m
English
A job is a fire-and-forget task. An operation that, once started, you will not be waiting on, unless, maybe, there's an exception. The most common way to create a job is to use the launch() coroutine builder, as shown:
fun main(args: Array<String>) = runBlocking { val job = launch { // Do background task here }}
However, you can also use the Job() factory function, like this:
fun main(args: Array<String>) = runBlocking { val job = Job()}
Read now
Unlock full access