Comments (6)
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.
Can you say a bit more, @rgreinho? What caused you not to succeed, for example?
from wg-async.
We're still investigating, so hopefully we will find solutions soon :)
But here are our two big blockers so far:
-
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 toreqwest
and could usesurf
orhreq
, 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. -
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.
@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.
This week's writing sessions -- I expect we'll schedule more for next week.
from wg-async.
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)
- Structured concurrency
- Structured, concurrent parallelism
- async Drop or cleanup mechanism
- async File API
- async Socket APIs
- Plan: async versions of traits HOT 1
- async Generator
- Plan: Send bounds for AFIT HOT 1
- Plan: Spawn trait
- async fn main and #[test]
- for await
- Combinators 2.0
- Global executor
- Maybe-async HOT 2
- RFC: Trait transformers HOT 1
- Plan: Rust 2024 prelude HOT 17
- Stabilization: async_fn_in_trait
- Stabilization: return_position_impl_trait_in_trait
- Stabilization: impl_trait_projections
- use GAT to redesign trait Stream HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wg-async.