Skip to content
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

Add ThreadPool::spawn_ok and spawn_obj_ok #1750

Merged
merged 1 commit into from
Jul 19, 2019

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Jul 19, 2019

Considering that spawn and spawn_obj never fail on the ThreadPool, it is desirable to add alternative methods that indeed cannot fail to spawn tasks.

I added this _ok suffix, otherwise that would be a breaking change. People's code would suddenly use the inherent method instead of the trait method, and likely get a compilation error because you can't call unwrap() on ().

Now that SpawnError unfortunately no longer contains the Future that failed to spawn, it is no longer possible to properly handle tasks spawn failures.

@cramertj cramertj merged commit 94dc00b into rust-lang:master Jul 19, 2019
@cramertj
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants