Skip to main content

Coroutines

Kotlin Extensions for LangChain4j

Discover Kotlin extensions for LangChain4j designed to transform the synchronous LangChain4j API into a modern, non-blocking experience with Kotlin Coroutines. Learn about key features including coroutine support for ChatLanguageModels, Kotlin Flow for streaming responses, external customizable prompt templates, and non-blocking document processing. Enhance your Kotlin programming skills and improve application efficiency by leveraging these powerful new tools.

Building Data Pipeline with Kotlin Coroutines Actors

This blog post demonstrates how to build a data processing pipeline using Kotlin coroutines and actors, showing both single-threaded and parallel implementations. It walks through creating a simple data pipeline using Kotlin’s channel and actor abstractions for clean concurrent programming. The post includes practical code examples of handling message passing between actors, managing thread pools, implementing back-pressure, and scaling from a basic sequential pipeline to a parallel version that processes data more efficiently. The explanation is backed by detailed logging output that illustrates how messages flow through the system and how parallel processing improves overall performance.