1. 15 12月, 2016 1 次提交
  2. 14 12月, 2016 1 次提交
    • A
      Allow HandlerFunction to return Mono<ServerResponse> · 582e625f
      Arjen Poutsma 提交于
      This commit makes it possible for handler functions to return
      asynchronous status codes and headers, by making HandlerFunction.handle
      return a Mono<ServerResponse> instead of a ServerResponse. As a
      consequence, all other types that deal with HandlerFunctions
      (RouterFunction, HandlerFilterFunction, etc.) had to change as well.
      
      However, when combining the above change with method references (a very
      typical use case), resulting signatures would have been something like:
      
      ```
      public Mono<ServerResponse<Mono<Person>>> getPerson(ServerRequest request)
      ```
      
      which was too ugly to consider, especially the two uses of Mono. It was
      considered to merge ServerResponse with the last Mono, essentialy making
      ServerResponse always contain a Publisher, but this had unfortunate
      consequences in view rendering.
      
      It was therefore decided to drop the parameterization of ServerResponse,
      as the only usage of the extra type information was to manipulate the
      response objects in a filter. Even before the above change this was
      suggested; it just made the change even more necessary.
      
      As a consequence, `BodyInserter` could be turned into a real
      `FunctionalInterface`, which resulted in changes in ClientRequest.
      
      We did, however, make HandlerFunction.handle return a `Mono<? extends
      ServerResponse>`, adding little complexity, but allowing for
      future `ServerResponse` subtypes that do expose type information, if
      it's needed. For instance, a RenderingResponse could expose the view
      name and model.
      
      Issue: SPR-14870
      582e625f
  3. 03 11月, 2016 1 次提交
  4. 02 11月, 2016 1 次提交
  5. 25 10月, 2016 1 次提交
    • B
      Refactor tests with ScriptedSubscriber · 99a32108
      Brian Clozel 提交于
      Reactor recently added the `ScriptedSubscriber` in its new
      `reactor-addons` module. This `Subscriber` revissits the previous
      `TestSubscriber` with many improvements, including:
      
      * scripting each expectation
      * builder API that guides you until the final verification step
      * virtual time support
      
      This commit refactor all existing tests to use this new
      infrastructure and removed the `TestSubscriber` implementation.
      
      Issue: SPR-14800
      99a32108
  6. 20 10月, 2016 3 次提交
    • A
      Align web.reactive.function with WebClient · 7e907c1e
      Arjen Poutsma 提交于
      This commit changes web.reactive.function to reflect the introduction of
      the new WebClient. Changes include:
      
      - Request -> ServerRequest
      - Response -> ServerResponse
      - FilterFunction -> HandlerFilterFunction
      - StrategiesSupplier -> HandlerStrategies
      7e907c1e
    • A
      Align Reactive WebClient with web.reactive.function · 0cfb6b37
      Arjen Poutsma 提交于
      This commit refactors the web client to be more similar to
      web.reactive.function. Changes include:
      
      - Refactor ClientWebRequest to immutable ClientRequest with builder and
         support for BodyInserters.
      - Introduce ClientResponse which exposes headers, status, and support
         for reading from the body with BodyExtractors.
      - Removed ResponseErrorHandler, in favor of having a ClientResponse
         with "error" status code (i.e. 4xx or 5xx). Also removed
         WebClientException and subclasses.
      - Refactored WebClientConfig to WebClientStrategies.
      - Refactored ClientHttpRequestInterceptor to ExchangeFilterFunction.
      - Removed ClientWebRequestPostProcessor in favor of
         ExchangeFilterFunction, which allows for asynchronous execution.
      
      Issue: SPR-14827
      0cfb6b37
    • A
      Moved BodyExtractor and BodyInserter to http.codec · dc1926a8
      Arjen Poutsma 提交于
      This commit moves the web.reactive.function.[BodyInserter|BodyExtractor]
      to http.codec, so that they can be used from the client as well.
      
      Furthermore, it parameterized both inserter and extractor over
      ReactiveHttpOutputMessage and ReactiveHttpInputMessage respectively, so
      that they can be limited to only be used on the client or server.
      dc1926a8
  7. 17 9月, 2016 6 次提交
  8. 12 9月, 2016 1 次提交
  9. 01 9月, 2016 2 次提交
    • A
      Introduce new functional web API · f1319f58
      Arjen Poutsma 提交于
      This commit introduces a new, functional web programming model in the
      org.springframework.web.reactive.function package. The key types
      are:
      
       - Request and Response are new Java 8-DSLs for access to the HTTP
         request and response
       - HandlerFunction represents a function to handle a request to a
         response
       - RoutingFunction maps a request to a HandlerFunction
       - FilterFunction filters a routing as defined by a RoutingFunction
       - RequestPredicate is used by Router to create RoutingFunctions
       - RequestPredicates offers common RequestPredicate instances
      f1319f58
    • A
      Refactored SseEvent to ServerSentEvent · 16b525f6
      Arjen Poutsma 提交于
       - Renamed SseEvent to ServerSentEvent to make the name less redundant.
       - ServerSentEvent is now immutable, having a builder to create new instances.
       - Realigned the class properties to more closely match the events
         described in the spec, so that `reconnectTime` becomes `retry`, and
         `name` becomes `event`.
      16b525f6
  10. 31 8月, 2016 1 次提交
  11. 08 8月, 2016 1 次提交
    • S
      Anticipate reactor.test.TestSubscriber removal · 5531e807
      Sebastien Deleuze 提交于
      reactor.test.TestSubscriber will not be part of Reactor Core
      3.0.0 since it needs to be refactored to fit all the needs
      expressed by the users. It is likely to be back later in one
      of the Reactor Core 3.0.x releases.
      
      This commit anticipate this removal by temporarily copying
      TestSubscriber in spring-core test classes. As soon as
      the new TestSubscriber will be available in Reactor Core,
      Spring Framework reactive tests will use it again.
      5531e807
  12. 28 7月, 2016 1 次提交
  13. 23 7月, 2016 1 次提交
  14. 21 7月, 2016 1 次提交
  15. 19 7月, 2016 1 次提交
  16. 16 7月, 2016 2 次提交
  17. 15 7月, 2016 1 次提交
  18. 08 7月, 2016 1 次提交
    • B
      Refactor HTTP client contracts · 4892436e
      Brian Clozel 提交于
      This commit refactors the `ClientHttpRequestFactory` into an
      `ClientHttpConnector` abstraction, in order to reflect that
      `ClientHttpRequest`s only "exist" once the client is connected
      to the origin server.
      
      This is why the HTTP client is now callback-based, containing all
      interactions with the request within a
      `Function<ClientHttpRequest,Mono<Void>>` that signals when it's done
      writing to the request.
      
      The `ClientHttpRequest` contract also adopts `setComplete()`
      and promotes that method to the `ReactiveHttpOutputMessage` contract.
      
      This commit also adapts all other APIs to that change and fixes a few
      issues, including:
      
      * use `HttpMessageConverter`s instead of `Encoders`/`Decoders`
      * better handle type information about request content publishers
      * support client cookies in HTTP requests
      * temporarily remove the RxNetty client support
      4892436e
  19. 01 7月, 2016 1 次提交
  20. 30 6月, 2016 1 次提交
  21. 29 6月, 2016 1 次提交
  22. 27 6月, 2016 1 次提交
  23. 24 6月, 2016 4 次提交
    • S
      Remove SseHttpMessageConverter · e6a0b39d
      Sebastien Deleuze 提交于
      CodecHttpMessageConverter is now suitable for SSE since it now
      handles default content type.
      e6a0b39d
    • A
      Fixed Undertow flush support · 52325a21
      Arjen Poutsma 提交于
      Reactored Servlet 3.1 and Undertow response support into an
      AbstractResponseBodySubscriber that uses an internal state machine,
      making thread-safity a lot easier.
      52325a21
    • S
      Take in account Rossen and Arjen feedbacks · 3c80c19c
      Sebastien Deleuze 提交于
      3c80c19c
    • S
      Add Server-Sent Events support · 90048122
      Sebastien Deleuze 提交于
      Flux<SseEvent> is Spring Web Reactive equivalent to Spring MVC
      SseEmitter type. It allows to send Server-Sent Events in a reactive way.
      Sending Flux<String> or Flux<Pojo> is equivalent to sending
      Flux<SseEvent> with the data property set to the String or
      Pojo value. For example:
      
      @RestController
      public class SseController {
      
      	@RequestMapping("/sse/string")
      	Flux<String> string() {
      		return Flux.interval(Duration.ofSeconds(1)).map(l -> "foo " + l);
      	}
      
      	@RequestMapping("/sse/person")
      	Flux<Person> person() {
      		return Flux.interval(Duration.ofSeconds(1)).map(l -> new Person(Long.toString(l), "foo", "bar"));
      	}
      
      	@RequestMapping("/sse-raw")
      	Flux<SseEvent> sse() {
      		return Flux.interval(Duration.ofSeconds(1)).map(l -> {
      			SseEvent event = new SseEvent();
      			event.setId(Long.toString(l));
      			event.setData("foo\nbar");
      			event.setComment("bar\nbaz");
      			return event;
      		});
      	}
      }
      90048122