Backpressure – the ability for a slow consumer to signal a fast producer to slow down – is a first-class concept in Web streams. In theory. In practice, the model has some serious flaws.
人 民 网 版 权 所 有 ,未 经 书 面 授 权 禁 止 使 用
。关于这个话题,爱思助手下载最新版本提供了深入分析
Ready for the answers? This is your last chance to turn back and solve today's puzzle before we reveal the solutions.
Что думаешь? Оцени!
Web streams has no synchronous path. Even if your source has data ready and your transform is a pure function, you still pay for promise creation and microtask scheduling on every operation. Promises are fantastic for cases in which waiting is actually necessary, but they aren't always necessary. The new API lets you stay in sync-land when that's what you need.