-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question on Internals #8
Comments
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 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) |
Hey! Sorry for the late reply. Your solution worked perfectly; using the third argument to 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. |
Hello!
I found your repo on JSR and I'm very impressed with it, especially with your use of Transform Streams. I started investigating using Transform Streams in my own work and I can't seem to get it working. Lmk if this issue should be moved somewhere else, I figured this was the best way to contact you.
Consider this test case
When running
deno test
on the test case above, it responds with an error as soon as it hitsawait w.write(element);
:Refactoring to use a
WritableStream
only (test 2 below) or to pipe aReadableStream
through (test 3 below) solves the error, but these approaches are undesirable. What am I doing wrong here? I've tried looking for guides on Transform Streams and consulting MDN's docs on them, and nothing has been helpful. I'm curious to see how you avoided the same errors in your own repo, because it seems inevitable given you use only aTransformStream
and don't use it as a pipe for any Readable Stream.Test 2
Test 3
Thanks so much for your time and for making such a high-quality library. I've starred this repo and hope to contribute to it when I can!
The text was updated successfully, but these errors were encountered: