-
Notifications
You must be signed in to change notification settings - Fork 5
Spring5新特性之Web Flux
Landy.Liu edited this page May 25, 2019
·
1 revision
- Non-blocking Programing
- NIO
- Reactive
Part of the answer is the need for a non-blocking web stack to handle concurrency with a small number of threads and scale with fewer hardware resources. Servlet 3.1 did provide an API for non-blocking I/O
- Functional Programing
- Lambda
The other part of the answer is functional programming.Much as the addition of annotations in Java 5 created opportunities (such as annotated REST controllers or unit tests), the addition of lambda expressions in Java 8 created opportunities for functional APIs in Java.
注意:Spring Web MVC和Web Flux是不能共存的。他们都不是线程安全的?
Spring Web MVC 是“抄袭”JSR规范而来的。
三流公司做产品,二流公司做技术,一流公司做规范。
Web Flux启动的是NettyWebServer,没有Servlet规范了,不依赖于Servlet容器了。Web MVC是依赖于Servlet规范的。
除了传统的请求外,还可以用Netty容器了。
跟Spring Web MVC是一致的。
Mono是Reactor中的一个概念,跟JDK中的Optional是一个概念。
SegmentFault: https://segmentfault.com/u/landy8530
简书:https://www.jianshu.com/u/36a7d3a994ac
CSDN:https://blog.csdn.net/landy8530
开源中国:https://my.oschina.net/landy8530
微信公众号:蚂蚁与咖啡的故事