图书 | RxJava反应式编程 |
内容 | 内容推荐 在今天这个手机APP驱动的时代,程序的异步性和响应性至关重要,响应式编程能帮助你编写更可靠、更易伸缩且性能更好的代码。在这本务实的书中,Java开发者首先会学习到如何用反应式视角看待问题,然后再借助这一令人兴奋的全新编程范式所提供的很好特性构建应用程序。作者Tomasz Nurkiewicz和 Ben Christensen引入了使用RxJava库的具体例子,解决安卓设备和服务端上的真实性能问题。你会学到RxJava如何利用并行和并发来帮助我们解决今天的问题。 作者简介 Tomasz Nurkiewicz是Allegro的一名软件工程师。过去十年他一直在用Java编程,他喜欢后端开发,对JVM语言和开源技术富有热情。Tomasz经常在DZone写博客,在优选靠前的Java大会发表演讲。 Ben Christensen是一名软件工程师,他曾在Apple、Netflix和Facebook工作过。Ben从上个世纪90年代就开始用Java编程,贡献了包括Hystrix和RxJava在内的多个开源项目。在NetflixAPI团队工作的时候,Ben成了反应式及函数式编程的粉丝。 目录 Foreword Introduction 1.Reactive Programming with RxJava Reactive Programming and RxJava When You Need Reactive Programming How RxJava Works Push versus Pull Async versus Sync Concurrency and Parallelism Lazy versus Eager Duality Cardinality Mechanical Sympathy: Blocking versus Nonblocking I/O Reactive Abstraction 2.Reactive Extensions Anatomy of rx.Observable Subscribing to Notifications from Observable Capturing All Notifications by Using Observer Controlling Listeners by Using Subscription and Subscriber Creating Observables Mastering Observable.create() Infinite Streams Timing: timer() and interval() Hot and Cold Observables Use Case: From Callback API to Observable Stream Manually Managing Subscribers rx.subjects.Subject ConnectableObservable Single Subscription with publishO.refCount() ConnectableObservable Lifecycle Summary 3.Operators and Transformations Core Operators: Mapping and Filtering 1-to-1 Transformations Using map() Wrapping Up Using flatMap0 Postponing Events Using the delay() Operator Order of Events After flatMap0 Preserving Order Using concatMap0 More Than One Observable Treating Several Observables as One Using merge() Pairwise Composing Using zip() and zipWith() When Streams Are Not Synchronized with One Another: combineLatest(), with Latest From(), and amb() Advanced Operators: collect(), reduce(), scan(), distinct(), and groupBy() Scanning Through the Sequence with Scan and Reduce Reduction with Mutable Accumulator: collect() Asserting Observable Has Exactly One Item Using single() Dropping Duplicates Using distinct() and distinctUntilChanged() Slicing and Dicing Using skip(), takeWhile(), and Others Ways of Combining Streams: concat(), merge(), and switchOnNext() Criteria-Based Splitting of Stream Using groupBy() Where to Go from Here? Writing Customer Operators Reusing Operators Using compose() Implementing Advanced Operators Using lift() Summary 4.Applying Reactive Programming to Existing Applications From Collections to Observables BlockingObservable: Exiting the Reactive World Embracing Laziness Composing Observables Lazy paging and concatenation Imperative Concurrency flatMap0 as Asynchronous Chaining Operator Replacing Callbacks with Streams Polling Periodically for Changes Multithreading in RxJava What Is a Scheduler? Declarative Subscription with subscribeOn() subscribeOn0 Concurrency and Behavior Batching Requests Using groupBy() Declarative Concurrency with observeOn() Other Uses for Schedulers Summary 5.Reactive from Top to Bottom Beating the C1Ok Problem Traditional Thread-Based HTTP Servers Nonblocking HTTP Server with Netty and RxNetty Benchmarking Blocking versus Reactive Server Reactive HTTP Servers Tour HTTP Client Code Nonblocking HTTP Client with RxNetty Relational Database Access NOTIFY AND LISTEN on PostgreSQL Case Study CompletableFuture and Streams A Short Introduction to CompletableFuture Interoperability with CompletableFuture Observable versus Single Creating and Consuming Single Combining Responses Using zip, merge, and concat Interoperability with Observable and CompletableFuture When to Use Single? Summary 6.Flow Control and Backpressure Flow Control Taking Periodic Samples and Throttling Buffering Events to a List Moving window Skipping Stale Events by Using debounce() Backpressure Backpressure in RxJava Built-in Backpressure Producers and Missing Backpressure Honoring the Requested Amount of Data Summary 7.Testing and Troubleshooting Error Handling Where Are My Exceptions? Declarative try-catch Replacement Timing Out When Events Do Not Occur Retrying After Failures Testing and Debugging Virtual Time Schedulers in Unit Testing Unit Testing Monitoring and Debugging doOn...() Callbacks Measuring and Monitoring Summary 8.Case Studies Android Development with RxJava Avoiding Memory Leaks in Activities Retrofit with Native RxJava Support Schedulers in Android UI Events as Streams Managing Failures with Hystrix The First Steps with Hystrix Nonblocking Commands with HystrixObservableCommand Bulkhead Pattern and Fail-Fast Batching and Collapsing Commands Monitoring and Dashboards Querying NoSQL Databases Couchbase Client API MongoDB Client API Camel Integration Consuming Files with Camel Receiving Messages from Kafka Java 8 Streams and CompletableFuture Usefulness of Parallel Streams Choosing the Appropriate Concurrency Abstraction When to Choose Observable? Memory Consumption and Leaks Operators Consuming Uncontrolled Amounts of Memory Summary 9.Future Directions Reactive Streams Observable and Flowable Performance Migration A.More HTTP Server Examples B.A Decision Tree of Observable Operators Index |
标签 | |
缩略图 | ![]() |
书名 | RxJava反应式编程 |
副书名 | |
原作名 | |
作者 | (美)托马什·勒克威茨(Tomasz Nurkiewicz),(美)本·克斯藤森(Ben Christensen) |
译者 | |
编者 | |
绘者 | |
出版社 | 东南大学出版社 |
商品编码(ISBN) | 9787564173708 |
开本 | 16开 |
页数 | 345 |
版次 | 1 |
装订 | 平装 |
字数 | 455千字 |
出版时间 | 2017-10-01 |
首版时间 | 2017-10-01 |
印刷时间 | 2017-10-01 |
正文语种 | |
读者对象 | |
适用范围 | |
发行范围 | |
发行模式 | 实体书 |
首发网站 | |
连载网址 | |
图书大类 | 人文社科-社会科学-语言文字 |
图书小类 | |
重量 | |
CIP核字 | |
中图分类号 | TN929.53 |
丛书名 | |
印张 | |
印次 | 1 |
出版地 | |
长 | |
宽 | |
高 | |
整理 | |
媒质 | |
用纸 | |
是否注音 | |
影印版本 | |
出版商国别 | |
是否套装 | |
著作权合同登记号 | |
版权提供者 | |
定价 | |
印数 | |
出品方 | |
作品荣誉 | |
主角 | |
配角 | |
其他角色 | |
一句话简介 | |
立意 | |
作品视角 | |
所属系列 | |
文章进度 | |
内容简介 | |
作者简介 | |
目录 | |
文摘 | |
安全警示 | 适度休息有益身心健康,请勿长期沉迷于阅读小说。 |
随便看 |
|
兰台网图书档案馆全面收录古今中外各种图书,详细介绍图书的基本信息及目录、摘要等图书资料。