DEV Community

Discussion on: Explain async like I'm five

Collapse
 
rhnonose profile image
Rodrigo Nonose

Sync is: saying "Good morning" and waiting for the person to reply.
Async is: writing a post-it saying "Good morning" and leaving on the person's desk.
You expect the response as a post-it in your desk as well.

Similar analogy for computing can be applied. When you want to call a method/function/procedure/endpoint or anything, you call it.
If the processing of that call is done in the same "concurrent unit" (aka process or thread) by the caller and the caller waits for the result to be finished, it's synchronous. Otherwise, it's asynchronous.