Hello, I would like to build a simple application to synchronize my photos with cloud storage.
For that I am going to use storage HTTP API.
I decided to take Hyper to build a HTTP client for uploading.
I would also like to have parallel uploads, say 10 photos at time.
The idea is very simple:
- There is source path to a photos directory.
- List that folder and prepare chunks 10 photos each.
- Upload the 1st chunk, take a little pause, then upload the 2nd one, and so on.
The problem is that I don’t understand how to enforce a pause between chunks.
I have tried to make it but it doesn’t work.
You can find relevant code here.
As far as I understand I couldn’t call
tokio::run multiple times, because it blocks the code (at least I couldn’t manage to get it work).
So, do I need to prepare a single future with chunk-sleep-chunk-sleep…?
Could you please help me to figure it out?