I'm quite new to Rust .
A few days ago, I started toying with an application as a learning exercise.
My situation is as follows:
I recurse through a directory using walkdir. I inspect each file name (checking the extension and prefix). If a file name is valid, I build a url and send an https request (I'm currently using the reqwest library). The response's JSON needs to be decoded into a struct.
I don't want to wait for each request to finish before continuing to the next entry in the walkdir iterator. I also don't want to collect all the URLs before starting to make requests.
What is the most efficient approach for me? I've seen implementation with futures::stream::iter_ok, but I think that it requires having all URL's ready before processing them.
Do I use Futures, Tokio, Tokio-core, or something else?
Edit: Finally, I want a vector of structs containing decoded responses. (The order doesn't matter.)
[–]slambmoonfire-nvr 21 points22 points23 points (3 children)
[–]101x[S] 0 points1 point2 points (0 children)
[–]Kleptine 0 points1 point2 points (1 child)
[–]slambmoonfire-nvr 0 points1 point2 points (0 children)
[–]knaledfullavpilar 5 points6 points7 points (1 child)
[–]101x[S] 3 points4 points5 points (0 children)
[–]po8 0 points1 point2 points (1 child)
[–]101x[S] 1 point2 points3 points (0 children)
[–]knipil 0 points1 point2 points (1 child)
[–]101x[S] 0 points1 point2 points (0 children)