RXJAVA反应式编程 影印版PDF电子书下载
- 电子书积分:12 积分如何计算积分?
- 作 者:(美)托马什·勒克威茨,本·克斯藤森著
- 出 版 社:南京:东南大学出版社
- 出版年份:2017
- ISBN:9787564173708
- 页数:348 页
1.Reactive Programming with RxJava 1
Reactive Programming and RxJava 1
When You Need Reactive Programming 3
How RxJava Works 4
Push versus Pull 4
Async versus Sync 5
Concurrency and Parallelism 8
Lazy versus Eager 12
Duality 13
Cardinality 15
Mechanical Sympathy:Blocking versus Nonblocking I/O 20
Reactive Abstraction 25
2.Reactive Extensions 27
Anatomy of rx.Observable 27
Subscribing to Notifications from Observable 30
Capturing All Notifications by Using Observer<T> 32
Controlling Listeners by Using Subscription and Subscriber<T> 32
Creating Observables 34
Mastering Observable.create() 35
Infinite Streams 38
Timing:timer()and interval() 43
Hot and Cold Observables 43
Use Case:From Callback API to Observable Stream 45
Manually Managing Subscribers 49
rx.subjects.Subject 51
ConnectableObservable 53
Single Subscription with publish().refCount() 54
ConnectableObservable Lifecycle 56
Summary 59
3.Operators and Transformations 61
Core Operators:Mapping and Filtering 61
1-to-1 Transformations Using map() 64
Wrapping Up Using flatMap() 67
Postponing Events Using the delay()Operator 72
Order of Events After flatMap() 73
Preserving Order Using concatMap() 75
More Than One Observable 77
Treating Several Observables as One Using merge() 78
Pairwise Composing Using zip()and zipWith() 79
When Streams Are Not Synchronized with One Another:combineLatest(),withLatestFrom(),and amb() 83
Advanced Operators:collect(),reduce(),scan(),distinct(),and groupBy() 88
Scanning Through the Sequence with Scan and Reduce 88
Reduction with Mutable Accumulator:collect() 91
Asserting Observable Has Exactly One Item Using single() 92
Dropping Duplicates Using distinct()and distinctUntilChanged() 92
Slicing and Dicing Using skip(),takeWhile(),and Others 94
Ways of Combining Streams:concat(),merge(),and switchOnNext() 97
Criteria-Based Splitting of Stream Using groupBy() 104
Where to Go from Here? 107
Writing Customer Operators 107
Reusing Operators Using compose() 108
Implementing Advanced Operators Using lift() 110
Summary 115
4.Applying Reactive Programming to Existing Applications 117
From Collections to Observables 118
BlockingObservable:Exiting the Reactive World 118
Embracing Laziness 121
Composing Observables 123
Lazy paging and concatenation 124
Imperative Concurrency 125
flatMap()as Asynchronous Chaining Operator 131
Replacing Callbacks with Streams 136
Polling Periodically for Changes 138
Multithreading in RxJava 140
What Is a Scheduler? 141
Declarative Subscription with subscribeOn() 150
subscribeOn()Concurrency and Behavior 154
Batching Requests Using groupBy() 158
Declarative Concurrency with observeOn() 159
Other Uses for Schedulers 163
Summary 164
5.Reactive from Top to Bottom 165
Beating the C10k Problem 165
Traditional Thread-Based HTTP Servers 167
Nonblocking HTTP Server with Netty and RxNetty 169
Benchmarking Blocking versus Reactive Server 177
Reactive HTTP Servers Tour 183
HTTP Client Code 184
Nonblocking HTTP Client with RxNetty 184
Relational Database Access 187
NOTIFY AND LISTEN on PostgreSQL Case Study 189
CompletableFuture and Streams 193
A Short Introduction to CompletableFuture 193
Interoperability with CompletableFuture 198
Observable versus Single 202
Creating and Consuming Single 203
Combining Responses Using zip,merge,and concat 205
Interoperability with Observable and CompletableFuture 207
When to Use Single? 208
Summary 209
6.Flow Control and Backpressure 211
Flow Control 211
Taking Periodic Samples and Throttling 212
Buffering Events to a List 214
Moving window 220
Skipping Stale Events by Using debounce() 221
Backpressure 226
Backpressure in RxJava 227
Built-in Backpressure 231
Producers and Missing Backpressure 233
Honoring the Requested Amount of Data 237
Summary 242
7.Testing and Troubleshooting 243
Error Handling 243
Where Are My Exceptions? 244
Declarative try-catch Replacement 247
Timing Out When Events Do Not Occur 251
Retrying After Failures 254
Testing and Debugging 258
Virtual Time 258
Schedulers in Unit Testing 260
Unit Testing 262
Monitoring and Debugging 270
doOn...()Callbacks 270
Measuring and Monitoring 272
Summary 275
8.Case Studies 277
Android Development with RxJava 277
Avoiding Memory Leaks in Activities 278
Retrofit with Native RxJava Support 280
Schedulers in Android 285
UI Events as Streams 288
Managing Failures with Hystrix 291
The First Steps with Hystrix 292
Nonblocking Commands with HystrixObservableCommand 294
Bulkhead Pattern and Fail-Fast 295
Batching and Collapsing Commands 297
Monitoring and Dashboards 303
Querying NoSQL Databases 306
Couchbase Client API 306
MongoDB Client API 307
Camel Integration 309
Consuming Files with Camel 309
Receiving Messages from Kafka 310
Java 8 Streams and CompletableFuture 310
Usefulness of Parallel Streams 312
Choosing the Appropriate Concurrency Abstraction 314
When to Choose Observable? 315
Memory Consumption and Leaks 315
Operators Consuming Uncontrolled Amounts of Memory 316
Summary 321
9.Future Directions 323
Reactive Streams 323
Observable and Flowable 323
Performance 324
Migration 325
A.More HTTP Server Examples 327
B.A Decision Tree of Observable Operators 333
Index 339
- 《化学反应工程》许志美主编 2019
- 《程序逻辑及C语言编程》卢卫中,杨丽芳主编 2019
- 《药物合成反应》姚其正主编 2019
- 《微笑 影印本》N.达列基作 1947
- 《全国职业院校工业机器人技术专业规划教材 工业机器人现场编程》(中国)项万明 2019
- 《教自闭症孩子主动发起和自我管理 应用关键反应训练提高社交技能》(美)Lynn Kern Koegel,(美)Robert L. Koegel著 2019
- 《金丝髪 侦探小说 影印本》格离痕著 1914
- 《编程超有趣 奇妙Python轻松学 第1辑》HelloCode人工智能国际研究组 2018
- 《全国高等医药院校药学类实验教材 药物合成反应实验 第3版》翟鑫 2019
- 《我的第一套编程启蒙绘本 看事件 开始了》编程猫教研团队编绘 2019
- 《SQL与关系数据库理论》(美)戴特(C.J.Date) 2019
- 《魔法销售台词》(美)埃尔默·惠勒著 2019
- 《看漫画学钢琴 技巧 3》高宁译;(日)川崎美雪 2019
- 《优势谈判 15周年经典版》(美)罗杰·道森 2018
- 《社会学与人类生活 社会问题解析 第11版》(美)James M. Henslin(詹姆斯·M. 汉斯林) 2019
- 《海明威书信集:1917-1961 下》(美)海明威(Ernest Hemingway)著;潘小松译 2019
- 《迁徙 默温自选诗集 上》(美)W.S.默温著;伽禾译 2020
- 《上帝的孤独者 下 托马斯·沃尔夫短篇小说集》(美)托马斯·沃尔夫著;刘积源译 2017
- 《巴黎永远没个完》(美)海明威著 2017
- 《剑桥国际英语写作教程 段落写作》(美)吉尔·辛格尔顿(Jill Shingleton)编著 2019