官术网_书友最值得收藏!

What this book covers

Chapter 1, Hello, Concurrent World!, is a friendly introduction to concurrency. Starting with concepts such as processes, threads, and coroutines, and then diving into the differences between concurrency and parallelism, you will learn about the common challenges of concurrent code, Kotlin's approach to concurrency, and some of the terminology that will be needed throughout the book.

Chapter 2, Coroutines in Action, takes you through a hands-on first experience with coroutines. We will create an empty Android project and work our way to doing networking using coroutines. We will also discuss different approaches to asynchronous operations with their advantages and my recommendations.

Chapter 3, Lifecycle and Error Handling, explains the lifecycle of coroutines and how to handle errors when using them. Then, we will put the theory in practice by adding error handling to the RSS reader created in the previous chapter.

Chapter 4, Suspending Functions and the Coroutine Context, covers the essential coroutine context, the one piece of configuration of your coroutine that allows you to define and modify its behavior. We will cover the usage of contexts to define the thread of a coroutine and for error handling.

Chapter 5, Iterators, Sequences, and Producers, dives into some primitives that allow data sourcing and data processing to be made suspending. We will talk, in detail, about how and when to use them, and we'll put this knowledge to test by implementing content loading on demand.

Chapter 6, Channels, Share Memory by Communicating, explains the really important concept of channels, starting with their use cases, covering the different types and their differences, and making it to a real-life application. We will use channels to perform concurrent searches in a group of RSS feeds.

Chapter 7, Thread Confinement, Actors, and Mutexes, lists three different tools that are provided by the coroutines framework to avoid errors such as atomicity violations and race conditions. In this chapter, you will learn how to use thread confinement, actors, and mutual exclusions, which are fundamental when writing safe concurrent code.

 Chapter 8, Testing and Debugging Concurrent Code, focuses on how to make the most out of your tests. We talk about functional tests, the three premises for testing concurrent code, and the configuration of your project to make the most out of your logs. We will also cover how to debug your concurrent code so that you avoid noise from other threads or coroutines.

Chapter 9, The Internals of Concurrency in Kotlin, analyzes how suspending functions, thread enforcing, and exception handling work during execution. It gives you a low-level understanding by both describing what the compiler does and by exploring the current implementation of many of the classes, both in the stdlib and in the coroutines library.

主站蜘蛛池模板: 榆树市| 拉萨市| 武威市| 东宁县| 利川市| 淮北市| 无为县| 忻城县| 甘南县| 瑞安市| 托里县| 盐山县| 绵阳市| 台北县| 新民市| 隆化县| 延庆县| 綦江县| 富裕县| 呼图壁县| 河间市| 沙雅县| 荥经县| 承德市| 宜阳县| 买车| 桦川县| 卓尼县| 平和县| 石首市| 平江县| 故城县| 龙海市| 中超| 永寿县| 竹山县| 康马县| 吐鲁番市| 禹城市| 白水县| 绥滨县|