Sign in to confirm you’re not a bot
This helps protect our community. Learn more
Graceful Resource Handling Using Structured Concurrency in Kotlin
Modern programming often requires us to guarantee how our applications terminate. One way to do this is through structured concurrency, which allows us to reason about parallel processes and how they relate. In this session, we will learn how to use Arrow’s Resource Domain-Specific Language (DSL) to reason about resource safety, like we use structured concurrency to avoid leaking resources. We will also see how this can be combined with KotlinX Coroutines to build complex use cases and elegantly use Kotlin DSLs. #kotlin #structuredconcurrency #coroutines Demo source code: https://github.com/nomisRev/ktor-k8s-... Speaker: Simon Vergauwen, Tech Lead at 47 Degrees 0:00 Introduction 2:44 Problem description 5:00 Rolling out the application in Kubernetes 8:20 Adding shutdown hooks 10:32 Introducing SuspendApp 13:52 Why graceful shutdown is essential? 19:50 Graceful shutdown in action 21:20 Structured concurrency 24:44 More about SuspendApp for Ktor 32:10 What is resourceScope? 36:20 More extensions for working with the environment in Ktor 46:00 Using Either and handling errors 56:20 Working with dependencies 1:03:35 Summary

Follow along using the transcript.

Kotlin by JetBrains

88K subscribers