Skip to Content
RxJava反应式编程
book

RxJava反应式编程

by Tomasz Nurkiewicz, Ben Christensen
December 2019
Beginner to intermediate
330 pages
10h 7m
Chinese
Posts & Telecom Press
Content preview from RxJava反应式编程
152
5
程数量有限,并且其中有一部分意外阻塞时,这可能会造成灾难性的影响。还记得基于
RxNetty
的服务器吗?它们最多只会使用几十个线程。另外一种灾难性的场景就是频繁调
URL.equals() 的时候,比如在 Set<URL> 中。URL 这种意料之外的行为是众所周知的,这
就好比一个事实:它的 equals() 实际会生成的结果取决于
Internet
的连接状况。
指出这一点只是为了说明编写反应式应用程序非常困难,而且陷阱重重。下一节将会介绍
另外一个更明显的阻塞源:数据库访问代码。
5.3
 关系数据库访问
在前面的部分,我们已经得出结论:每个服务器最终都会成为不同服务的客户端。还有一
个非常有意思的现象,目前使用的计算机系统几乎全都是分布式的。由网线连接的两台计
算机需要进行通信时,在空间上实际已经是分布式的了。更极端一点,你可以将每台计算
机都想象成一个分布式系统,各个独立的
CPU
核心缓存并不总是一致的,它们必须通过
消息传递协议来实现同步。现在,让我们对比一下应用程序服务器和数据库服务器架构。
Java
领域,关系数据库访问长期存在的标准是
Java
数据库连接
Java Database
Connectivity
JDBC
)。从消费者的角度来说,
JDBC
提供了一组
API
与关系数据库进行通
信,这些数据库包括
PostgreSQL
Oracle Database
等。核心的抽象是
Connection
TCP/
IP
,线路连接)、Statement
(数据库查询)和
ResultSet
(查看数据库结果) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey
Java并发编程

Java并发编程

道格拉斯·施密特
Spark快速大数据分析(第2版)

Spark快速大数据分析(第2版)

Jules S. Damji, Brooke Wenig, Tathagata Das, Denny Lee

Publisher Resources

ISBN: 9787115524003