11 unstable releases (3 breaking)

0.4.0 Sep 20, 2024
0.3.1 Sep 9, 2024
0.3.0 Aug 30, 2024
0.2.0 Jul 12, 2024
0.1.2 Aug 14, 2020

#132 in Network programming

Download history 255/week @ 2024-08-20 336/week @ 2024-08-27 959/week @ 2024-09-03 1036/week @ 2024-09-10 1463/week @ 2024-09-17 1411/week @ 2024-09-24 798/week @ 2024-10-01 548/week @ 2024-10-08 805/week @ 2024-10-15 467/week @ 2024-10-22 446/week @ 2024-10-29 700/week @ 2024-11-05 619/week @ 2024-11-12 451/week @ 2024-11-19 401/week @ 2024-11-26 796/week @ 2024-12-03

2,401 downloads per month
Used in deadpool-memcached

MIT license

60KB
1K SLoC

async-memcache

async-memcache is an async memcached client implementation for Tokio.

Warning: This is a work in progress crate.

Testing

The default test suite does not require memcached to be running. It will ignore tests that require memcached to be running.

cargo test

For the full test suite, you need to have memcached installed and running.

cargo test && cargo test -- --ignored

Benchmark

To run the benchmark, you need to have memcached installed and running.

memcached -p 11211 -t 10 -c 10000 -m 1024
cargo bench

Examples

You can run the examples with cargo run --example <example-name>. Example require memcached running.

TCP:

cargo run --package async-memcached --example basic

Unix:

memcached -p 11211 -t 10 -c 10000 -m 1024
memcached -vv -s /tmp/memcached.sock
cargo run --package async-memcached --example unix

Profiling

Install samply with cargo install samply.

samply record cargo run --package async-memcached --example unix

Features

This crate only targets the ASCII protocol, as the binary protocol has been deprecated and is no longer actively being improved.

  • TCP connection
  • UDP connection
  • UNIX domain socket connection
  • Authentication
  • TLS

Releasing a new version

Developers should keep a running log of changes being made with each PR in CHANGELOG.md, under the [Unreleased] - ReleaseDate header to ensure that accurate change records are kept as part of the release cycle.

To release a new version of this crate, you must be part of the Owners group listed on crates.io. If you are not part of this group and require a release that includes recently merged changes, please open an issue on Github.

When using the cargo-release crate to release a new version, the version field in Cargo.toml will be bumped automatically according to the <LEVEL> argument that has been provided. Additionally, CHANGELOG.md will have version and date fields updated automatically. See the cargo-release documentation for more info on versioning and options.

cargo publish workflow:

Expand this section for `cargo publish` workflow details
  • Ensure the your main branch is up to date:
$ git checkout main
$ git pull
  • Checkout a new branch with the release version name:
$ git checkout -b "release v<VERSION>"
  • Update the version field in Cargo.toml to reflect the desired new version of the crate, following semantic versioning best practices.
  • Update the CHANGELOG.md such that the latest changes are under a header with the new version & release date:
## [Unreleased] - ReleaseDate

### Added
- a cool new feature

### Changed
- something to be more optimized

Should be updated to:

## [Unreleased] - ReleaseDate

## [Major.Minor.Patch] - 20YY-MM-DD

### Added
- a cool new feature

### Changed
- something to be more optimized
  • Push your changes to the remote, get approval and merge your PR
  • Update your main branch again:
$ git checkout main
$ git pull
  • Run cargo publish --dry-run to perform a dry run, ensuring that your publishing process will proceed as expected.
  • Run cargo publish to publish the new version of this crate to crates.io.

cargo release workflow:

Expand this section for `cargo release` workflow details
  • Ensure the main branch is up to date:
$ git checkout main
$ git pull
  • Checkout a new branch with the release version name:
$ git checkout -b "release v<VERSION>"
  • Open a PR on GitHub and fill out the PR template for a release. Provide the cargo release dryrun output in the PR body.
Expand this selection to see example dryrun output with the `Cargo.toml` and `CHANGELOG.md` files changed:
$ cargo release patch -v
[2024-09-09T17:37:47Z DEBUG reqwest::connect] starting new connection: https://index.crates.io/
[2024-09-09T17:37:48Z DEBUG cargo_release::steps] Files changed in async-memcached since v0.3.0: [
        "/async-memcached/CHANGELOG.md",
        "/async-memcached/benches/bench.rs",
        "/async-memcached/src/connection.rs",
        "/async-memcached/src/lib.rs",
        "/async-memcached/src/value_serializer.rs",
    ]
[2024-09-09T17:37:48Z DEBUG globset] glob converted to regex: Glob { glob: "**/*", re: "(?-u)^(?:/?|.*/)[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true, empty_alternates: false }, tokens: Tokens([RecursivePrefix, ZeroOrMore]) }
[2024-09-09T17:37:48Z DEBUG globset] built glob set; 0 literals, 1 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 1 regexes
   Upgrading async-memcached from 0.3.0 to 0.3.1
[2024-09-09T17:37:48Z DEBUG cargo_release::ops::cargo] change:
    --- /async-memcached/Cargo.toml   original
    +++ /async-memcached/Cargo.toml   updated
    @@ -1,6 +1,6 @@
     [package]
     name = "async-memcached"
    -version = "0.3.0"
    +version = "0.3.1"
     authors = ["Toby Lawrence <toby@nuclearfurnace.com>"]
     edition = "2018"
     readme = "README.md"

[2024-09-09T17:37:48Z DEBUG cargo_release::steps::release] updating lock file
[2024-09-09T17:37:48Z DEBUG cargo_release::ops::replace] processing replacements for file async-memcached/CHANGELOG.md
   Replacing in CHANGELOG.md
--- CHANGELOG.md        original
+++ CHANGELOG.md        replaced
@@ -10,6 +10,8 @@

 ## [Unreleased] - ReleaseDate

+## [0.3.1] - 2024-09-09
+
 ### Changed

 - `set` and `add` methods can now accept `uint`-type argument for value in addition to `&str` and `&String` types.  The original implementation used an `AsRef` trait bound, which has been replaced with a custom `AsMemcachedValue` trait bound that should cover all of the applicable incoming types.
  • Once your PR is approved, run cargo release <LEVEL> -v --execute and select yes (y) to confirm that you would like to publish to crates.io. This will automatically update the version field in Cargo.toml and replace the ## [Unreleased] - ReleaseDate header in CHANGELOG.md with the appropriate version and date automatically, and then publish the crate with those changes included. These changes will also be pushed to your remote branch.
  • Merge your PR so that main and the released crate version are in parity.

License

MIT

Dependencies

~7–14MB
~173K SLoC