Reputation: 391
As someone newly investigating reactive programming, I'm having a question seems not answered elsewhere:
How does a blocking call (i.e http request from frontend) really utilize this concept?
My understanting is this, and question is about correction if its mistaken:
Are those assumptions correct?
Going further for lets yes basic understanding is correct, what makes this kind of approach more suitable from a thread-based approach?
Assume in my case, expected concurrent users aren't really that big, top 500 people at the same time.
Upvotes: 5
Views: 559
Reputation: 20707
Your assumtions are correct in general. This is how almost any rather modern web-app be it vertx, micronaut or spring-boot+ works.
If the user expects the request to be synchronous (meaning he's waiting till it finishes) then the server has to execute it in a blocking manner, BUT without blocking itself, so that other users can also fire their requests in parallel.
Reactive on it's own is rather the way how you structure your code, i.e. in RxJava instead of callbacks (hell) you use methods chains, but it doesn't change the nature of request processing in general.
Upvotes: 2