-
Notifications
You must be signed in to change notification settings - Fork 161
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
Latency-bounded reads #1270
Comments
Can the purpose be fulfilled by something like |
This doesn't help with platform streams like Response body. |
Hmm yeah, #616 could allow TransformStream based control: stream.pipeThrough(new TransformStream({
transform(chunk, c) {
c.enqueue(chunk);
return new Promise(r => setTimeout(r, 10));
}
})) For now this only works for non-BYOB readers, so the usefulness is limited for byte streams. |
I don't think this can be solved in the underlying source. Your example adds a 10ms delay between each chunk, whereas the OP wants to add a 10ms delay between each |
Many media-related use cases complain that there's a lot of overhead from unnecessary wakeups from
read()
, as streaming network reads use too much CPU and power. They would benefit from latency-bounded reads i.e. "try to fulfill read() once, 10ms from now, with all the data you've received between now and then".In addition to
min
in #1145, it might be good to have something likedeadline
as an option forread()
to allow for latency-bounded reads.cc @ricea
The text was updated successfully, but these errors were encountered: