Delete ReactiveEventServer.java
This commit is contained in:
parent
733f3f50c8
commit
d9d9b5731c
|
@ -1,21 +0,0 @@
|
||||||
package com.baeldung.reactive.controller;
|
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import reactor.core.publisher.Flux;
|
|
||||||
|
|
||||||
import java.time.Duration;
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/events")
|
|
||||||
public class ReactiveEventServer {
|
|
||||||
|
|
||||||
@GetMapping(path = "/stream/" , produces=MediaType.TEXT_EVENT_STREAM_VALUE)
|
|
||||||
public Flux<String> eventStream() {
|
|
||||||
return Flux.interval(Duration.ofSeconds(1)).map(tick -> {return "Event:" + tick;});
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue