-
Notifications
You must be signed in to change notification settings - Fork 226
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
feat: impl spawn_catch_unwind() #319
base: master
Are you sure you want to change the base?
Conversation
/// In this example, a server is started and `spawn` is used to start a new task | ||
/// that processes each received connection. | ||
/// |
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.
This is a copy-paste error, since the provided example is not a TCP server, let's just remove this sentence.
1674877
to
37515bf
Compare
T: Future + 'static, | ||
T::Output: 'static, | ||
{ | ||
use futures::{FutureExt, TryFutureExt}; |
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.
Using futures_util
instead of futures
can reduce dependencies. Or fork CatchUnwind
can avoid introducing new dependency.
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.
Or fork CatchUnwind can avoid introducing new dependency.
Yeah, this makes more sense
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.
Could you change in any of these 2 ways?
Note if you choose to fork code, remember to add enough note for the copyright.
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.
Could you change in any of these 2 ways?
Yeah, I will, I am just busy with my work.
Note if you choose to fork code, remember to add enough note for the copyright.
Get it.
What does this PR do
Adds a new spawn function that will catch the spawned task's panic.
Closes #314