Everyone seems to be talking about Reactive application these days and Reactive manifesto seems to encourage non blocking/asynchronous code. I've seen a ton of videos on youtube where the speakers are encouraging non blocking code but no one says the benefit of writing non blocking code over blocking other than saying
"using futures is good because it is not blocking your code" - some speaker
This is just making "blocking code" sound like a bad word.
My question is simple: If I have a task and I run it with:
- Blocking code - Where runs the task on one thread
- Non blocking code - Where one thread delegates the task to another thread
The fact is that the actual task I want to run is always going to run on 1 thread in the above two cases. The second option just adds more complexity to the application and the first one is simpler and probably faster since I don't have to delegate.
I understand at some point during the execution of a task there will be a need perform multiple concurrent tasks so Threads/non blocking/async code helps here. But why does Reactive manifesto encourages non blocking applications ground up ? What is the benefit other than a whole bunch of Futures and Promises in your applications which is just making the code more complicated and harder to debug ?