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

feature(async): Add tokio as an executor option #36

Merged
merged 3 commits into from
Jan 28, 2023

Commits on Jan 25, 2023

  1. Configuration menu
    Copy the full SHA
    54935bb View commit details
    Browse the repository at this point in the history
  2. feature(async): Add tokio as an executor option

    This PR is based on the work @alexschrod did in PR zkat#29. All
    I did was carry it over the finish line.
    
    This PR adds a feature to the crate named `tokio-runtime`. If
    you disable default features and enable this new one, cacache
    uses tokio as its async executor. This makes integrating cacache
    with tokio-using projects easier, because the file types leak out
    if you use anything more than the top-level convenience functions.
    
    The PR implements the feature using shims in a new submodule named
    `async_lib`. This module conditionally uses either async-std
    or tokio based on feature selection, and hides some differences with
    convenience functions.
    
    This change should not be a breaking change, because the default is
    still async-std.
    
    There are a few other small changes in this PR worth noting.
    
    - The README shows how to switch runtimes.
    - There's a justfile to run common tasks, including those in makefile.toml.
      The default shell is `sh`, so this might not work out of the box for
      Windows users.
    - The tests can now run under either runtime. The justfile has a recipe
      that runs them both.
    - The benchmarks can also run under either runtime. The justfile has two
      recipe for this, one using bench and the other using criterion's runner.
    - The dependencies now pull in async-attributes by default along with
      async-std. This made it easier to swap runtimes in the tests.
    - All dependency versions have been bumped.
    
    Co-authored-by: @alexschrod
    ceejbot committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    15536af View commit details
    Browse the repository at this point in the history
  3. Re-order imports to satisfy neatness urges

    (I have this exact urge too but missed this one)
    ceejbot committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    859e1ba View commit details
    Browse the repository at this point in the history