Coder Social home page Coder Social logo

streams-demo's People

Contributors

domenic avatar kenjibaheux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

streams-demo's Issues

[question] Browser support?

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?

Incorrect byte counter?

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)

User must opt-in to cors-anywhere

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.

Uses much memory on Chrome possibly because long promise chain uses memory a lot on Chrome

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();
        });
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.