So I understand that under the hood Spring WebFlux and Reactor uses netty for nio, now I would like to release the calling thread to free up the resources in order to handle more requests. Is the below simple code releasing the calling thread?
@GetMapping("/foo")
public Mono<Void> bar() {
someService.veryLongSyncOperation();
return Mono.empty();
}
I did not wrap the service call in a Flux/Mono, I just want to first verify that the calling thread is released while the service does its long work. Is this enough to achieve calling thread release? If so is there a way to test this?
I was thinking that the framework sees the return type and that's enough for it to know that it must release the calling thread.