14
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 07 Dec 2024
14 points (100.0% liked)
Rust
6137 readers
12 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
I would say:
.clone()
stuff to fix lifetime errors. It's not optimal but consider that in C++ everything is pretty much cloned by default, and nobody ever said C++ was slow.anyhow::Result
for error handling. It's the easiest option.Thanks! One of the reasons for choosing Rust was actually concurrency. So I’m building a bunch of endpoints that connect with some microservices and I expect to have many simultaneous requests. I’m honestly not like super senior but for the Python backends we’ve been building we always made everything asynchronous so I kinda got the impression that that would be necessary for my use cases. Should I also be careful with async functions when using Poem?
Rust async has quite a lot of footguns that other async runtimes don't have. There are some listed here:
Honestly if you're using an async Rust web framework (which they pretty much all are) it may be the path of least resistance to still use async. But in general I would strongly prefer scoped threads, channels, rayon etc.
Unlikely to be so many that threads would be an issue.
Thanks! This is something I had no idea could be an issue. I just started standing up all the dummy functions for the different layers so I’ll take a step back now and review the resources you pointed me at. Also, in the Poem docs I don’t see them using async functions either. I’m very glad I asked.