New
v1.5.0 File streaming
Overview
- File streaming, now Telego properly streams files from file system (or other readers) and doesn't load them in memory multiple times
- :boom: Breaking changes done in
telegoapi.RequestData, now it hasBodyRawandBodyStreaminstead of justBuffer, this change was necessary to improve how files are sent and since it's low level API that is rarely (probably never) implemented by users it's acceptable (99.99% of users should not see any change at all, only improved performance) - Previously sending 20 Mb file used ~68 Mb of RAM (since file was loaded in memory 3 times), with new implementation only ~3 Mb (most of which is probably HTTP server for pprof and testing)
- :boom: Now
RetryCallerhas new optionBufferRequestData(defaults to false) which is used if request contains files (body stream), this is needed to retry requests with files (by default such requests will be sent once and fail on second request on EOF)
What's Changed
- Bump github.com/valyala/fasthttp from 1.68.0 to 1.69.0 by @dependabot[bot] in https://github.com/mymmrac/telego/pull/327
- Async file reader by @mymmrac in https://github.com/mymmrac/telego/pull/329
Full Changelog: https://github.com/mymmrac/telego/compare/v1.4.0...v1.5.0