Advertisement

Kotlin Coroutine Jobs (Beginner Example)

Kotlin Coroutine Jobs (Beginner Example) High quality Android programming courses:

In this video I take you through a beginner level kotlin coroutines example. Specifically, this example is about kotlin coroutine jobs.

In the past, handling things like: Network timeouts, cancellations, multiple asychronous operations at once, were all very difficult.
- AsyncTask it was a nightmare
- Executors was an improvement but still not great
- RxJava is pretty good
- BUT coroutines are by far the BEST

Coroutines have an object called "Completable Job".

Why you should care about a completable job:
- Can be used to launch coroutines in their own independent context.
- Job that can be completed manually by you (you have more control)
- Ability to very easily cancel jobs and create new ones
- Take action when a job is cancelled
- Example: throw exception, display toast, display error dialog

Instagram:

code:

kotlin coroutines,coroutines,android coroutines,android kotlin coroutines,android kotlin coroutines tutorial,android kotlin coroutines job,coroutine job,kotlin coroutines job,kotlin coroutines tutorial,kotlin thread,kotlin thread tutorial,kotlin coroutines concurrent,kotlin concurrency,kotlin coroutines example,codingwithmitch kotlin,

Post a Comment

0 Comments