I'm kind of new to Reactive Stream, so I got a question when using Spring Webflux and Reactor.
I made a snippet like below:
@RestController
public class TestController {
@GetMapping("responsebody/flux")
public Flux<String> tt2() {
return Flux.range(1, 5)
.delayElements(Duration.ofMillis(1000))
.map(l -> "hi");
}
}
and, interestingly, the chrome shows the each element in the sequence separately, rather exposes all at a time when I request it just using browser. (But dev tools shows whole body at once)
But I'm wondering that, HOW IT WORKS when even HTTP 1 uses only one connection, and the data server sent is put in the body in HTTP protocol. HOW can the client know which separates each element and when the sequence completes? and what if client is not ready to use reactive stream?
I don't need any code using reactive library, but wanna know how the protocol works.