eclipse-vertx / eclipse-vertx/vert.x
Add an optional argument to HttpServerResponse.sendFile() to control whether the response is ended
- Dominant language
- Java
- Stars
- 14.7k
- Forks
- 2.1k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 30
Description
Add an optional argument to `HttpServerResponse.sendFile()` that indicates whether the response should be ended.
Currently, `sendFile` always ends the response. This prevents sending data from more than one file.
This would be similar in nature to `Pipe.endOnComplete()`.
This option would be also be available on the `sendFile(filename, offset)` and `sendFile(filename, offset, length)` variants as well, so partial files could also be sent.
Use case: We have an S3 storage service where multipart objects are stored in multiple files. We can send single part S3 objects with `sendFile`. But, when sending multipart objects (ranges), we must compose `Pipe` futures with `endOnComplete(false)`, which does not take advantage of the zero-copy IO features of Linux.
I would not be able to contribute, but would be able to test the feature.
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.