-
Notifications
You must be signed in to change notification settings - Fork 163
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
Add readableAmount getter to ReadableByteStream #279
Conversation
I'm making a PR to update the ReadableByteStream to address #266. I'll make ref impl change once it's done. |
I wonder if this should be a getter or a method. Right now it is a method on the underlying source but a getter on the stream. I think either:
Alternately we could come up with more complicated schemes like making it a method on the underlying source that we only call at certain times and then cache the result of, and then a getter on the stream returns the cached result. |
Oops. I accidentally merged this as 127df9e. Anyway let's continue the discussion (here I guess?). I'll leave it as a getter externally/method on underlying source for now. |
FWIW if the solution for the MSE case is being moved to only being addressed by ReadableByteStream, then I don't think readableAmount is needed. If I understand the ReadableByteStream correctly, I think MSE should simply be able to call readInto() with the size it needs and everything would be fine. It looks like readInto() essentially acts like POSIX read() so that would be sufficient for MSE's needs. I suppose this is a long way of saying, don't add readableAmount just for MSE. :) |
Even in the new async read() byte stream Domenic is working on at #296, you can call Kindly hold! |
But when I revisited the issue, I think that it doesn't make much sense.
If reading into a single contiguous buffer doesn't really matter, we can just read into some small buffer and process bytes in it repeatedly. It just works.
|
No description provided.