Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
5333f9cb
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5333f9cb
编写于
12月 29, 2016
作者:
R
Rossen Stoyanchev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Doc updates
上级
6bf12812
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
12 deletion
+14
-12
src/asciidoc/web-reactive.adoc
src/asciidoc/web-reactive.adoc
+14
-12
未找到文件。
src/asciidoc/web-reactive.adoc
浏览文件 @
5333f9cb
[[web-reactive]]
= Web Reactive Framework
= Reactive Web Applications
This section provides basic information on the reactive programming
support for Web applications in Spring Framework 5.
...
...
@@ -15,16 +16,17 @@ In plain terms reactive programming is about non-blocking applications that are
and event-driven and require a small number of threads to scale vertically (i.e. within the
JVM) rather than horizontally (i.e. through clustering).
A key aspect of
the
reactive applications is the concept of backpressure which is
A key aspect of reactive applications is the concept of backpressure which is
a mechanism to ensure producers don't overwhelm consumers. For example in a pipeline
of reactive components extending from the database to the HTTP connection when the
HTTP client is slow the data repository also slows down or stops until capacity frees up.
of reactive components extending from the database to the HTTP response when the
HTTP connection is too slow the data repository can also slow down or stop completely
until network capacity frees up.
Reactive programming also
involves a major shift from imperative style logi
c
to declarative async composition of logic. It is comparable to using `CompletableFuture`
in Java 8 and composing
follow-up actions via lambda expressions.
Reactive programming also
leads to a major shift from imperative to declarative asyn
c
composition of logic. It is comparable to writing blocking code vs using the
`CompletableFuture` from Java 8 to compose
follow-up actions via lambda expressions.
For a
more extended introduction to reactive programming check the excellent multi-part
series
For a
longer introduction check the blog
series
https://spring.io/blog/2016/06/07/notes-on-reactive-programming-part-i-the-reactive-landscape["Notes on Reactive Programming"]
by Dave Syer.
...
...
@@ -51,14 +53,14 @@ by Sebastien Deleuze.
[[web-reactive-feature-overview]]
== Spring Web Reactive
Overview
== Spring Web Reactive
Module
Spring Framework 5 includes a new `spring-web-reactive` module. The module contains support
for reactive HTTP and WebSocket clients as well as for reactive server web applications
including REST, HTML browser, and WebSocket style interactions.
[[web-reactive-server]]
=== Server
-Side Reactive Web Support
=== Server
Side
On the server-side the new reactive module supports 2 distinct programming models:
...
...
@@ -153,7 +155,7 @@ https://spring.io/blog/2016/09/22/new-in-spring-5-functional-web-framework[M3 re
[[web-reactive-client]]
=== Client
-Side Reactive Web Support
=== Client
Side
Spring Framework 5 includes a functional, reactive `WebClient` that offers a fully
non-blocking and reactive alternative to the `RestTemplate`. It exposes network
...
...
@@ -190,7 +192,7 @@ still based and relies on `InputStream` and `OutputStream`.
[[web-reactive-http-body]]
===
Encoding and Decoding the Request and Response Body
===
Request and Response Body Conversion
The `spring-core` module provides reactive `Encoder` and `Decoder` contracts
that enable the serialization of a `Flux` of bytes to and from typed objects.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录