COURSE

Kotlin Coroutines

Gain a complete understanding of Kotlin Coroutines, from first principles to advanced topics like structured concurrency with best practices built-in.

  • 2 Days
  • Intermediate
  • In-person / Online
  • £ On Request

Your team will 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, actor 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.

COURSE

Kotlin Coroutines

Gain a complete understanding of Kotlin Coroutines, from first principles to advanced topics like structured concurrency with best practices built-in.

  • 2 Days
  • Intermediate
  • In-person / Online
  • £ On Request

ShapeCreated with Sketch.
ShapeCreated with Sketch.
image/svg+xml
image/svg+xml