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

Set up Tokio runtime in main() #3082

Merged
merged 1 commit into from
Aug 20, 2021
Merged

Set up Tokio runtime in main() #3082

merged 1 commit into from
Aug 20, 2021

Commits on Aug 19, 2021

  1. Set up Tokio runtime in main()

    Each entrypoint to the container bits sets up a tokio runtime,
    which is inefficient and duplicative.  We're also likely
    to start using Rust async in more places.
    
    Instead, create a Tokio runtime early in our `main`, and
    change the CLI entrypoint to be an `async fn`.
    
    The other setup of a runtime we have is deep inside the
    sysroot upgrader bits, also for the container.  In this
    case we actually have another thread (distinct from the main one
    where we set up Tokio) created by C/C++, so we need to pass
    a `tokio::runtime::Handle` across, and call `enter()` on it
    to set up the thread local bindings to access tokio async
    from there.
    
    I was initially looking at properly handling `GCancellable`
    with tokio and wanted to clean this up first.
    cgwalters committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    83501b0 View commit details
    Browse the repository at this point in the history