Похожие чаты

Node makes an asynchronous call to read the file, remembers

to call a callback when reading is done, and continues to execute the current stack. When node is idle, it waits for the os to report it's done reading the file, and then it calls the callback

there would be no any advantage for aysnc right ?
there is. While the async operation is not done yet, node can run other code, such as processing other requests

1 ответов

2 просмотра

there is. While the async operation is not done yet, node can run other code, such as processing other requests but what if there is only one statement after this async operation and that statement needs the output of the previous aysnc call ? in this case there would be no advantage of using callbacks and async operations right ?

Похожие вопросы

Обсуждают сегодня

Anyone here suffers from unexplained aural migraines, who would be up for talking for a bit? Doesn't *have* to be aural, but I am not asking about headaches, I mean actual mi...
Martin Rys
55
Сonst magicTgHTML = (text, entities) => { let processedText = text; let offsetShift = 0; entities.forEach(entity => { const { offset, length, type, url, ...
Андрей
1
A couple thoughts from a random internet stranger: 1. If you want this project to gain traction you cannot keep being negative. If I just came here after finding out about Kd...
Eric Wild
45
Здравствуйте товарищи! решил всё таки поставить линукс. Порядок создание разделов /boot/efi 200МиБ; /boot 1000; подсистему / 80000; swap 8Гб Будет норм?
K2
18
How Will #Monero Be Attacked? First of all I want to tell you that this is not teaching the network attackers, the central regulators. They already know how to attack the net...
Li₿ΞʁLiøη
3
подскажите пожалуйста, как мне освободить результат записанный в переменную result? в чем проблема подскажите если МОЖЕТЕ?
Михаил Helper
28
есть тут кто-то , кто только начал изучать си? если проходите курс на степике или как-то сами изучаете, пишите, может, скооперируемся?..
Eule
25
Слушайте, ещё такая интересная задачка. Сделан аудит действий пользователей через триггеры в базе, соответственно каждый пользователь имеет свой логин и пароль в базе. Это пре...
Сергей Бычков
12
Кстати, раз про скачивание файлов разговор зашел) Сделал бота для себя (транскрибирующего и суммаризирующего встречи) но не ожидал что за 2 месяца 10к пользователей набежит😅...
Andrey Obolenskiy
8
вопрос по москвину - не понимаю вот такого вопроса похоже Сколько разных всегда завершающихся функций с типом a -> a -> b -> a -> a можно реализовать? Две функции одинаково...
Fedor
11
Карта сайта