diff --git a/index.bs b/index.bs index 1082cab2a..9850776d7 100644 --- a/index.bs +++ b/index.bs @@ -4964,6 +4964,21 @@ writable stream: .catch(e => console.error("Something went wrong!", e)); +
+ This specific style of wrapping a web socket interprets web socket messages directly as chunks. + This can be a convenient abstraction, for example when piping to a writable stream or transform + stream for which each web socket message makes sense as a chunk to consume or transform. + + However, often when people talk about "adding streams support to web sockets", they are hoping instead for a new + capability to send an individual web socket message in a streaming fashion, so that e.g. a file could be transferred + in a single message without holding all of its contents in memory on the client side. To accomplish this goal, we'd + instead want to allow individual web socket messages to themselves be {{ReadableStream}} instances. That isn't what we + show in the above example. + + For more background, see this + discussion. +
+

A readable stream with an underlying push source and backpressure support

The following function returns readable streams that wrap "backpressure sockets," which are hypothetical objects @@ -5239,6 +5254,9 @@ We can then use this function to create writable streams for a web socket, and p .catch(e => console.error("Something went wrong!", e)); +

See the earlier note about this style of wrapping web +sockets into streams.

+

A writable stream with backpressure and success signals

The following function returns writable streams that wrap portions of the readable side will implicitly close the writable side, and similarly, closing or aborting the writable side will implicitly close the readable side. +

See the earlier note about this style of wrapping web +sockets into streams.

+

A transform stream that replaces template tags