Giter Club home page Giter Club logo

Comments (2)

crowlKats avatar crowlKats commented on July 21, 2024

Hey, so the issue is that you are writing contents to the stream, but not reading anything. basically, TransformStream doesnt buffer elements up, so writing and reading need to happen "simultaneously". the easiest way to achieve this in your first test is to not await the "Writing" step, but assigning it to a variable, and awaiting it after the "Reading" step. I know this might be a bit awkward and not ideal, but thats the only solution.

however, if you do want to buffer n-amount of elements, i believe you can try around with https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream#highwatermark (though not entirely sure, i rarely use this option and do not remember its inner workings from the top of my head)

from event.

ben-laird avatar ben-laird commented on July 21, 2024

Hey! Sorry for the late reply. Your solution worked perfectly; using the third argument to TransformStream to provide a queuing strategy to the underlying ReadableStream was the right call. The promises I was awaiting were queued up for the TransformStream to process, but they were never settled, hence the error I got. It's also why your use of TransformStream works: there's a reader attached to the ReadableStream side immediately, negating the need for a queue.

Thanks so much again for your help, and I hope to offer my own help on this repo if you'd like and when I can. I'll close this as completed.

from event.

Related Issues (4)

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.