Re: [whatwg/streams] Fix makeReadableBackpressureByteSocketStream to drain all data (#504)

Hmm. I guess I have to admit I didn't understand the problem we were solving; I was hoping you would just work out a simple solution that would make sense when I read it :). Let me try to understand better now...

In https://github.com/ricea/streams/pull/1/files/1941c5b9244184941dbb27a23bde42d7de77e627#r72926215 @ricea says

> Careful inspection of the code indicates that the event is level-triggered. In other words, returning from onreadable without reading all available data results in another "readable" event being fired immediately. Should I mention this explicitly?

Since onreadable is a hypothetical API, I am wondering what code you are inspecting, @ricea?

Taking this behavior as a given though, I don't necessarily see a problem with just letting `onreadable` fire immediately. If it does, the second time we fire we will just repeat the logic, fulfilling any further BYOB read requests (if they exist) or enqueuing the data (if no such requests exist). That seems to work OK, right? Why is the version in this PR better?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/504#issuecomment-237762357

Received on Friday, 5 August 2016 05:55:02 UTC