Tmpod
09/02/2023, 12:37 AMByteReadChannel
, write packets to a ZipOutputStream
-wrapped ByteChannel
(passing .toOutputStream()
), wrap all that in a ChannelProvider
and pass that to the upload.
Specifically, I'm using Kord as the library that gives me the download and upload points. It gives me URLs for the downloadable files and composes file uploads as multipart requests, passing the channels, unconsumed, to ktor.
That seemed to be working fine, but it turns out ktor will just timeout in the process, and it has proven quite hard to debug.
So, I'd like to know if anyone has attempted something like this, and how I should go about it.
In theory I could just download them one by one, zip them safely and then pass the whole thing to the upload, but that's far from ideal.
To sum it up, I have a bunch of URLs pointing to resources I wanna archive together in a .zip and send to another URL via a multipart request, all streamed to minimize the memory footprint (due to potentially arbitrarily large sources). The download, zip and upload should be concurrent, like a continuous pipeline.
Thank you in advance! :)