[99s-extend] Big body via REST

Loïc Hoguin essen at ninenines.eu
Thu Feb 7 15:41:03 CET 2013


On 02/07/2013 11:04 AM, Sergey Yelin wrote:
> Hi list,
>
> how properly send big response (hundreds of megabytes) via REST callback? As far as I can see REST handler in cowboy handles special case for callback functions (cowboy_rest.erl, line 844): {stream, StreamFun} - is it right place for stream big response from SQL database?

Hey,

If you know the size, reply with {stream, Size, StreamFun}, otherwise 
{stream, StreamFun}, with StreamFun the function that will send all the 
data to the socket.

-- 
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu



More information about the Extend mailing list