GithubHelp home page GithubHelp logo

processing urls in batches about wg-async HOT 6 OPEN

rust-lang avatar rust-lang commented on June 29, 2024
processing urls in batches

from wg-async.

Comments (6)

nikomatsakis avatar nikomatsakis commented on June 29, 2024 1

The basic format is that the host asks you (and others) a bunch of questions about your experiences and then we try to collectively write a story about one of the characters. It's fun. :)

from wg-async.

nikomatsakis avatar nikomatsakis commented on June 29, 2024

Can you say a bit more, @rgreinho? What caused you not to succeed, for example?

from wg-async.

rgreinho avatar rgreinho commented on June 29, 2024

We're still investigating, so hopefully we will find solutions soon :)

But here are our two big blockers so far:

  1. Not sure how to limit the number of requests sent at the same time asynchronously. In Python the
    aiohttp web client can be configured with a smaller connection pool size and handles it for us. We hoped that reqwest would do the same. Note that we're not specifically attached to reqwest and could use surf or hreq, but unfortunately we found out that they behave the same way.

    Our second hope was that the FuturesUnordered container would allow us to manage this.

    A comment in the SO question pointed us to this question, where they create a Stream and apply the buffer_unordered() method on it. That will be our next attempt.

    Coming from a Python background, we hoped we could simply use the same pattern, where the asyncio.gather() function from the stdlib executes the coroutines and collects the results, that's why we went with the FuturesUnordered container first.

  2. We do not know how to retry failed requests. We did find the backoff crate and the tokio-retry one, but they don't seem to work well with FuturesUnordered. Or at least we did not succeed to get them to work together.

    In Python we use tenacity to decorate our functions, and if an exception is caught, it tries to re run them for us.

We are also having problems with the error handling. We could not get the map_err() and or_else() method to work as expected. But this is probably simply do to the fact that we're new to this and did not use them properly. I'm sure we will figure it out soon. Same thing with the logging, the tracing-rs library looks fantastic.

from wg-async.

nikomatsakis avatar nikomatsakis commented on June 29, 2024

@rgreinho any chance you want to join a "vision doc writing session" and talk about this? What time zone are you in? :)

from wg-async.

nikomatsakis avatar nikomatsakis commented on June 29, 2024

This week's writing sessions -- I expect we'll schedule more for next week.

from wg-async.

rgreinho avatar rgreinho commented on June 29, 2024

Sure thing! Not sure how that works, or what exactly is expected from participants, but I'll be glad to help.

I am in the CDT time zone.

from wg-async.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.