DEV Community

Cover image for Explain me async like I am a Kid
Adzy
Adzy

Posted on

5

Explain me async like I am a Kid

Help me!

Peace ✌

Top comments (8)

Collapse
 
bwca profile image
Volodymyr Yepishev • Edited

You're told to clean your room. You agree but don't do it right away because you've got more important things at hand. Once you've finished with those, you either clean your room or you don't. Your cleaning the room is asynchronous task, because in a queue after the stuff you're busy with.

That's basically event loop with micro and macro tasks and pending/resolved Promises in JavaScript 🤓

Collapse
 
foxy4096 profile image
Adzy

I like cleaning my room.

Collapse
 
shuckster profile image
Conan

Like? Tell me your secrets!

Thread Thread
 
foxy4096 profile image
Adzy

I do my work while I am half asleep.

Collapse
 
esfoliante profile image
Miguel Ferreira

You turn on the TV to watch your favourite cartoon. However, it will take a while for the show to start so you play with your action figures meanwhile :D

The action of turning on the TV and waiting for the response (the show) is an asynchronous function

Collapse
 
foxy4096 profile image
Adzy

Nice, thank you

Collapse
 
bias profile image
Tobias Nickel

When someone give you a promise, you have to await the result.

Collapse
 
foxy4096 profile image
Adzy

True Words

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more