Let me explain my concept first, Event loop is a single thread whose job is to register and trigger callbacks and callback are run on a separate thread i.e in Node process event loop is a thread and another thread for executing callbacks. If I am right until now, then why do a cpu intensive task block the event loop ? In case, if event loop waits for callbacks to finish and then trigger next event, how will it be asynchronous, because it waits for every callback to finish. Any nice explanation will be appreciated
Aucun commentaire:
Enregistrer un commentaire