Add 'send' and `end` to Worker Response object


Now that KV is in place and large result sets may be possible, it would be useful to have send and end added as methods on the Response object in Workers. This would allow single results or blocks of results could be sent to the browser separately. As it is now, a Worker has to assemble all results into a single JSON object to send to the client. Since Response.body is a proper ReadStream in the browser, it would be trivial to write a client reader that could consume these one at a time. See also: Workers KV, Response Object Inadequate



@adaptive … you seem to be in the know. Any thoughts on this. Seems imperative for KV at scale.



Turns out there is a recipe that addresses this: