[whatwg/streams] batched TransformStream transform()? (#574)

https://github.com/whatwg/streams/issues/551#issuecomment-255667934 proposing some kind of `lowWaterMark` got me thinking. Would it be worth it to change `transformer.transform` to be passed an array of chunks, instead of a single chunk?

By default with only one element, but with options that would enable
- specifying a maximum total size of the batched chunks (the maximum desired value of `writableStrategy.size(chunks[0])+writableStrategy.size(chunks[1])+...` (this would, for obvious reasons, be required to be lower than `highWaterMark`)
- specifying a minimum total size of the batched chunks, such that `transform()` calls are delayed until sufficient chunks have been enqueued in the writable end

Could putting that kind of logic into TransformStream instead of having the transformer implement its own, third, internal queue and batching logic be useful?

-- 
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/issues/574

Received on Thursday, 27 October 2016 18:51:30 UTC