Breaking news! Here’s a blog post about async Rust, and it’s not a philosophical debate1! Today we’re going down the rabbit hole of

Download Accelerator - Async Rust Edition

submited by
Style Pass
2024-05-06 11:30:04

Breaking news! Here’s a blog post about async Rust, and it’s not a philosophical debate1! Today we’re going down the rabbit hole of download accelerators, though of course that’s just an excuse to explore a living async Rust program. After all, I spent last 12 months writing quite some async code, so I thought I’d give back and share a taste of its exotic flavor. If you have been reluctant to try async because of a negative sentiment on the internet, I hope this post may trigger your curiosity. Bon appétit!

For the impatient: you can jump to the second half of this post that dives into the technical details, or you can even go straight to the code.

Still here? Glad to see at least one person decided to read on! The subsections below provide some background before moving on to the implementation bits: what is a download accelerator? How is that related to async programming? Is any of this relevant for “real-world software development” ™?

Download accelerators were quite popular back in the good old days, when most websites offered low bandwidth per connection. As you can imagine, downloading big files was slow, so people started looking for a creative workaround. It was a matter of time till someone came up with a smart and effective idea: if the server throttles bandwidth per HTTP connection… why not start multiple connections at the same time, letting each of them retrieve a chunk2 of the file in parallel?

Leave a Comment