Server-side Kotlin, Exploring coroutines, thinking about architectural topics. Learning and sharing

Kotlin Coroutines in Practice

Discover Kotlin’s killer feature for handling non-blocking and asynchronous code. With Kotlin coroutines, we can write idiomatic, performant code, drastically simplifying complex scenarios.

In this talk, we will discuss its building blocks, use cases, and quickly get going with live coding segments demonstrating the power and flexibility of Coroutines.

Presentation Link: https://www.canva.com/design/DAFyNVx4pw0/pu1Zlc09eyDai_APX79W2A/view

Repository Link: https://github.com/renatomrcosta/Coroutines-DevFestHH23/

A Pattern for Composing Flow Operations

Kotlin Flows are powerful tools to handle streams of data in a suspending manner.

Similar to RxJava Observables and Reactor’s Flux, Flows represent a sequence of values that can be emitted over time. However, Flows have several key differences: They are the Coroutines-enabled way to process streams of data, they have support for backpressure, and a much more streamlined API. With Flows, as any part of the Kotlin Coroutines library, developers can write asynchronous, non-blocking code in a more natural and intuitive way.

And, while most of the very useful operators are widely documented (such as the game-changing transform operator), the composition and extension pattern for Flows is something that I don’t think I see mentioned often.

In this article, We shall explore this pattern, and hopefully add another tool to our toolbox when composing flow code.

Continue reading →

Why Non-Blocking?

Non-blocking systems have become more commonplace and accessible due to the rich choice of tools and programming approaches. But in my current experience, programmers used to a more traditional blocking approach tend to quickly become confused about non-blocking or reactive systems, at times even confusing the terms “non-blocking” with “asynchronicity”.

In this article we will review the current status of blocking systems by building and examining a simple Spring Boot application. We will talk about how they behave. Then we will introduce Kotlin Coroutines, and how they can help us to model our non-blocking services.

Continue reading →