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

task: add Builder::{spawn_on, spawn_local_on, spawn_blocking_on} #4683

Merged
merged 4 commits into from May 14, 2022

Commits on May 12, 2022

  1. task: improve Builder::spawn_local docs

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed May 12, 2022
    Copy the full SHA
    5b98b3a View commit details
    Browse the repository at this point in the history
  2. task: add Builder::{spawn_on, spawn_local_on, spawn_blocking_on}

    `task::JoinSet` currently has both `spawn`/`spawn_local` methods,
    and `spawn_on`/`spawn_local_on` variants of these methods that take a
    reference to a runtime `Handle` or to a `LocalSet`, and spawn tasks on
    the provided runtime/`LocalSet`, rather than the current one. The
    `task::Builder` type is _also_ an API type that can spawn tasks, but it
    doesn't have `spawn_on` variants of its methods. It occurred to me that
    it would be nice to have similar APIs on `task::Builder`.
    
    This branch adds `task::Builder::spawn_on`,
    `task::Builder::spawn_local_on`, and `task::Builder::spawn_blocking_on`
    methods, similar to those on `JoinSet`. In addition, I did some
    refactoring of the internal spawning APIs --- there was a bit of
    duplicated code that this PR reduces.
    hawkw committed May 12, 2022
    Copy the full SHA
    dc8c5b2 View commit details
    Browse the repository at this point in the history
  3. actually the prev approach was better

    it only incremented the spawner's refcount
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed May 12, 2022
    Copy the full SHA
    8607183 View commit details
    Browse the repository at this point in the history
  4. fixup

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed May 12, 2022
    Copy the full SHA
    fafc4fe View commit details
    Browse the repository at this point in the history