if ("ignoreUnhandledRejections" in this) {
ignoreUnhandledRejections();
}
// Example of a stream that enqueues data asynchronously, whether the reader // wants it or not, the "push" model.
let fbStream = new ReadableStream({
start(controller) {
simulatePacketsDriftingIn(controller);
},
});
async function simulatePacketsDriftingIn(controller) { for (let i = 1; i <= 30; i++) {
let importantData =
(i % 15 == 0 ? "FizzBuzz" :
i % 5 == 0 ? "Buzz":
i % 3 == 0 ? "Fizz" :
String(i));
controller.enqueue(importantData);
await asyncSleep(1 + i % 7);
}
controller.close();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.