Search code examples
erlangyaws

What is the difference between chunk and non-chunk streaming in Erlang/Yaws


What is the difference between yaws_api:stream_process_deliver(Socket, IoList) and yaws_api:stream_process_deliver_chunk(Socket, IoList)?


Solution

  • The difference between yaws_api:stream_process_deliver(Socket, IoList) and yaws_api:stream_process_deliver_chunk(Socket, IoList) has to do with HTTP 1.1 Transfer Coding. The first function transfers the provided data as is to the HTTP client, while the second uses chunked transfer to send the data to the client.

    Please see section 7.5 of the Yaws PDF documentation for more details.