Learning Netty from scratch - 1. Blocking, Non-Blocking && Synchronous, Asynchronous

Let’s try to understand these 4 concept by an example.

Suppose, You want to boil some water. Suppose you are Process A, and the kettle which can boil water is Process B. The task here is that you would like to boil water by your kettle.

Synchronous : You have a super old-styled kettle so that it will not notice you when it finishes the task, you have to observe it all the time to make sure everything works fine. In other words. You have Processs A calls B, B will not notify A until it completes.

Asynchronous: Nowadays, Kettles will automatically have someway to notify you when they accomplish the task. In other words, ** When A calls B, B will immediately return A an message shows that B have recived the task.After B finish the task, B will notify A in someway.

The biggest difference between synchronous and asynchronous is that how the callee returns the result . If the callee return the result until it finish the whole request from the caller, this is synchronous. And, if the callee return a notice to the caller once it receive the request and after it completes, it try to nofity the caller, this is asychronize.


Author: Liang Tan
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Liang Tan !
  TOC