Comments (2)
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.
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)
- .close() type conflict HOT 2
- mapping for denoland/dnt HOT 1
- @denosaurs/event in JSR HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from event.