7

Controlling the Data Flow

Having discussed coroutines in the previous chapter, we will now broaden our exploration to include features that enhance communication and data handling across different coroutines. This chapter focuses on further important aspects of Kotlin’s concurrency toolkit, namely channels and flows. We will also look into higher-order functions for collections, noting their APIs’ similarity to those of channels and flows.

Building on the foundation laid by our discussion of functional programming, this chapter will emphasize the use of small, reusable, and composable functions. These functions enable us to write expressive code that clearly outlines what we want to achieve, rather than focusing on the steps needed to accomplish ...

Get Kotlin Design Patterns and Best Practices - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.