-
-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use async-std in multipart example and treat all errors #228
Use async-std in multipart example and treat all errors #228
Conversation
Test has been fixed on master, could you drop the commit? |
f83af59
to
d2bd1bf
Compare
Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good with one minor nit. It's nice that we can remove block part :)
let's create new example for async-std |
Ah, okay, @torfmaster could you create a new example as @fafhrd91 mentioned? |
d2bd1bf
to
408962d
Compare
Okay, I created a new example. |
408962d
to
935405d
Compare
Thanks! |
I'm curious how the event loop is handled with this under the hood. Using async_std in tandem with tokio means multiple runtimes, no? |
@actix/contributors, can any of y'all shed some light on how this works under the hood?
|
@cdbattags please reserve the callout to all contributors for matters of importance |
@Dowwie, uhh, what does "matters of importance" mean here? If people use |
This is why @JohnTitor put out a blast to us 3 days ago about potentially trimming the team. |
@cdbattags - sorry, nieve question, is the tokio runtime running in the context of this example? |
@jwdeitch |
Well, Now, how |
From the documentation of |
My concern is that if we're showing this as a certified example then the architecture of the whole setup changes. Where would we like to document this kind of stuff? |
Ideally, all futures spawned by usages of |
I concur with @cdbattags that this example is problematic. actix/examples is an official repo showing acceptable patterns, not anti-patterns. With that given, @cdbattags are you going to submit a PR to fix? Alternatively, it could be enhanced and documented to explain why this setup is problematic. "See this? Don't do this. Here's why." |
Yup, the same happens with |
I'd say this isn't necessarily an "anti-pattern" but there's no great solution yet to mixing Someday soon if the traits start lining up then it won't be a concern but for now we need to advertise the weirdness of this under the hood. |
Summary
In this PR I use
async_std
instead of blocking. Moreover, I treat all errors. I hope this makes the code more streamlined.