Facebook Pixel

Kotlin Coroutines

  • 2 Days
  • Intermediate
  • Virtual | Classroom
  • £ On Request

Fast-track your team to Kotlin Coroutines in just 2 days. A live classroom experience that teaches the language through a mix of explanation, demos, exercises, and live coding, all taught by industry veterans.

What you'll learn

Understand the purpose and advantages of Coroutines

Apply coroutines for asynchronous programming

Make use of all aspects of the Coroutines library

Explore practical applications of coroutines

Overview

Kotlin is a fantastic modern language with many killer features, but one of the best is Coroutines. Coroutines, as implemented in Kotlin, are an elegant way of solving many complex programming problems including asynchronous programming, actors models, lazy evaluated iteration and more.

In this course you’ll gain a complete understanding of Kotlin Coroutines. We’ll cover both the fundamentals, such as the difference between suspend functions and coroutines, and delve into many of the advanced features such as structured concurrency, cancellation and more.

Outline

Coroutine Fundamentals

  • What precisely is a Kotlin Coroutine?
  • Comparing Coroutines to Java Threads
  • Comparing Coroutines to the Stream API
  • How does a suspending function work?
  • The responsibilities of the compiler
  • The responsibilities of the library
  • Potential for multiple implementations
  • Choosing and using bridge functions
  • Sequences, channels and other abstractions
  • Behaviour when limits are met
  • Commonly applied asynchronous patterns

Structured Concurrency with Coroutines

  • A tour of the types within the Coroutines API
  • The importance of the CoroutineScope and Context
  • Defining Supervisor Scopes
  • Using the standard dispatchers and creating your own
  • Options (including actors) for sharing mutable state
  • Modelling asynchronous sequences of values as Flows
  • How different operators are implemented within Flows
  • Understanding context and termination within Flows

Coroutine Best Practices

  • Ensuring your Coroutine based design is fault tolerant
  • Managing exceptions in Coroutine code
  • Avoiding Deadlock with coroutines
  • Testing and validating coroutines

Requirements

All delegates should be familiar with the fundamentals of programming in Kotlin.

Ready to take the next step?

Group-based training for organisations. Get in contact to learn more.

Book for my Team

Related Kotlin Courses