Commit for Eval Article pull request

This commit is contained in:
smokeyrobot
2018-05-02 00:18:41 -04:00
committed by Kyle Doyle
parent e3978a5f95
commit c23ac47178
5 changed files with 128 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package com.baeldung.reactive.kdoyle;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import java.util.stream.Stream;
@RestController
public class ReadingController {
@GetMapping(produces = MediaType.TEXT_EVENT_STREAM_VALUE, value = "/read")
public Flux<ReadingBook> getWord(){
return Flux.fromStream(Stream.generate(() -> new ReadingBook()));
}
}