This method does not perform chunked transfer encoding. It merely sends the raw bytes emitted by the publisher. As such, it is generally preferable to {@link ResponseChunks render chunks} than use this method directly.
The response headers will be sent as is, without the implicit addition of a {@code Content-Length} header like the other send methods.
Back pressure is applied to the given publisher based on the flow control of the network connection. That is, items are requested from the publisher as they are able to be sent by the underlying Netty layer. As such, the given publisher MUST respect back pressure. If this is not feasible, consider using {@link ratpack.stream.Streams#buffer(org.reactivestreams.Publisher)}.
The back pressure applied will be irregular, based on factors including:
Data requested of the publisher is not always written immediately to the client. Netty maintains its own buffer that is fed by the given publisher. This means that data is more likely ready to send as soon as the client receives it.
If your data source produces a small amount of data that is expensive to produce (i.e. there is a significant latency between a data request and the production of data) you may want to consider an intermediate buffer to maximize throughput to the client. However, this is rarely necessary. @param stream a stream of byte bufs to be written to the response
|
|
|
|
|
|