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

Make task::Builder::spawn* methods fallible #4823

Merged
merged 3 commits into from
Jul 12, 2022
Merged

Commits on Jul 11, 2022

  1. task: make Builder::spawn* methods fallible

    Making the `task::Builder::spawn*` methods fallible allows applications
    to gracefully handle spawn errors (e.g. due to resource exhaustion)
    without tokio panicking internally.
    
    This change is also a good analogue for `std::thread::Builder` which has
    fallible spawn methods (whereas `std::thread::spawn` internally panics)
    ipetkov committed Jul 11, 2022
    Configuration menu
    Copy the full SHA
    ca58bee View commit details
    Browse the repository at this point in the history
  2. task: surface spawn_blocking errors through the Builder

    Using `tokio::task::spawn_blocking` continues to exhibit the previous
    behavior (panic if there aren't any worker threads available to accept
    the task, but return a dummy handle if the runtime is shutting down)
    ipetkov committed Jul 11, 2022
    Configuration menu
    Copy the full SHA
    c09b90e View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2022

  1. fix build

    ipetkov committed Jul 12, 2022
    Configuration menu
    Copy the full SHA
    cf181e8 View commit details
    Browse the repository at this point in the history