This chapter was all about collaborative concurrency. We were able to cover many different topics, from practical and technical points of view. Let's recap the chapter to keep the knowledge fresh:
- We discussed some real-life examples of using channels to solve challenges related to collaborative concurrency.
- We learned that channels are a communication tool, allowing us to safely send messages between coroutines regardless of their thread.
- We talked about unbuffered channels. These are channels that will suspend send() until receive() is called for each element.
- We also covered three different types of buffered channels: ConflatedChannel, which keeps only the last element that was sent; LinkedListChannel, which will never suspend when send() is called because it can hold unlimited elements – or at least as many as possible in the available memory; and ArrayChannel...