1. 程式人生 > >SprinBoot2.x響應式程式設計

SprinBoot2.x響應式程式設計

1、基礎理解:
        依賴於事件,事件驅動(Event-driven)
        一系列事件稱為“流”
        非同步
        非阻塞

        觀察者模式

    網上的一個例子:
        int b= 2;
        int c=3
        int a = b+c  //指令式程式設計後續b和c變化,都不影響a
        b=5;

        int b= 2;
        int c= 3
        int a = b+c  //響應式程式設計中,a的變化,會和b、c的變化而變化(事件驅動)
        b=5;

    2、官網:https://docs.spring.io/spring-boot/docs/2.1.0.BUILD-SNAPSHOT/reference/htmlsingle/#boot-features-webflux
        SpingBoot2底層是用spring5,開始支援響應式程式設計,Spring又是基於Reactor試下響應式。