Closed aboba closed 7 years ago
I'm not a fan of this model of supporting buffering. Two reasons:
On the other hand, it is easy to specify and implement, and I think that it's possible to implement the API I would prefer (waitForWritable) on top of it.
If we came up with a matching buffering solution for the read/receive side, I could overlook the clunkyness and look at its good characteristics. But I feel strongly that we should figure out a solution for both sides of buffering before proceeding with either.
I agree with @pthatcherg. The API model is clunky for data channels and it's clunky for QUIC streams, too.
Like I said in #785, the idealist in me wants to see an inherited WHATWG stream. But if that's too much to ask, then I'd go for write
and drain
(instead of the onbufferedamountlow
event) as suggested in this comment before. That proposal may also cover aspects of read buffering (I'm not exactly sure what @pthatcherg has in mind there). Feedback to that proposal would be much appreciated.
This patch adds support for buffering to the RTCQuicStream.write method. The
bufferedAmount
,bufferedAmountLowThreshold
andonbufferedamountlow
attributes are utilized to enable building anRTCDataChannel
interface on top of theRTCQuicStream
abstraction.@lgrahl @pthatcher Can you review/comment?