Open
Description
Basic summary
As a beginner in Rust, I would like to add to this thread with our real-life experience. We are currently facing issues which make me relate to this story (and are preventing us to switch to Rust):
We are trying to rewrite some of our services from Python to Rust and are looking to achieve the following:
- Read a bunch of URLs (size varies, but about 1000 per batch)
- Do an HTTP GET request for each URL asynchronously
- Log the failures and process the results
What we did not succeed to do so far is:
- Send the requests by batch. If we send the 1000 requests at the same time,
our server closes the connection and the process panics. Ideally we could
buffer them to send at most 50 at a time. We could split the batches manually,
but we hoped the HTTP client or theFuturesUnordered
container would handle
that for us. - Handle errors. Failures should be logged and should not crash the
process. We plan on using tracing-rs for the
logging as it is part of the tokio stack. - Implement Fibonacci or exponential retry mechanism on failure.
For reference, the stackoverflow question where I was looking for help.
Originally posted by @rgreinho in #95 (comment)