domenic / streams-demo Goto Github PK
View Code? Open in Web Editor NEWDemo for Fetch + Streams
Home Page: https://domenic.github.io/streams-demo/
Demo for Fetch + Streams
Home Page: https://domenic.github.io/streams-demo/
This is some really cool stuff. I know it's experimental, but how supported in modern browsers is it? It works in Chrome Canary, but will this feature work in Firefox, Opera, Safari, etc. in the near future?
promise streams are a great feature
simplified version of your demo: https://jsbin.com/wiwobe/edit?js,output
During receiving data and when result is found, eg
Found it! At position 92136059.
which equals to approximately 87Mb.
Meanwhile only 64.5Mb were transferred (according to the network Chrome tab)
Due to Rob--W/cors-anywhere#301, the cors-anywhere app does not work unless users opt-in directly. This demo does not work without that opt-in.
There should be a clear message on the demo page advising users to go to the site and opt in before trying to use the demo.
Bonus points if we catch a 403 from cors-anywhere and specifically alert users to the problem.
I think we discussed similar topic in the context of reviewing some example written by you for the Streams spec.
We got this report about fetch()'s memory usage. http://crbug.com/473062
We see ~100MB memory usage that doesn't decrease even we force GC. It seems it's for the promise chain.
If I changed the code to remove the chain, I saw only up to ~22MB memory usage on Chromium task manager.
Adding @yutakahirano to see if this is a problem to be solved by promises perspective or not.
function pump(reader) {
return new Promise(function (resolve, reject) {
function pumpStep() {
reader.read().then(function (result) {
if (result.done) {
progressText.textContent = `All done! (${soFar} bytes total)`;
resolve();
return;
}
...
if (found !== -1) {
progressText.textContent = `Found it! At position ${soFar - chunk.byteLength + found}.`;
resolve(reader.cancel());
} else {
pumpStep(reader);
}
});
}
pumpStep();
});
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.