Skip to content

Commit

Permalink
9.2.0 (#291)
Browse files Browse the repository at this point in the history
* feat: glommio support
* feat: add credential provider
* fix: mocked pipeline commands
* feat: support pipelined transactions

---------

Co-authored-by: Nuutti Kotivuori <[email protected]>
  • Loading branch information
aembke and nakedible-p authored Sep 4, 2024
1 parent b2f51e8 commit 3e6d00a
Show file tree
Hide file tree
Showing 104 changed files with 3,509 additions and 1,466 deletions.
38 changes: 32 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ jobs:
- test_valkey
test-misc:
docker:
- image: cimg/rust:1.78
- image: cimg/rust:1.80
environment:
CARGO_NET_GIT_FETCH_WITH_CLI: true
steps:
Expand All @@ -246,27 +246,53 @@ jobs:
command: cargo check --features partial-tracing
check-all-interface-features:
docker:
- image: cimg/rust:1.78
- image: rust:1.80-slim-bullseye
environment:
CARGO_NET_GIT_FETCH_WITH_CLI: true
YQ_VERSION: v4.44.3
steps:
- checkout
- run:
name: Install build dependencies
command: |
apt-get update && apt-get install -y build-essential libssl-dev pkg-config git wget
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64
chmod +x /usr/local/bin/yq
rustup component add clippy
- run:
name: Check all features
command: tests/scripts/check_features.sh
- run:
name: Check all Glommio features
command: tests/scripts/check_glommio_features.sh
clippy-lint:
docker:
- image: cimg/rust:1.78
- image: rust:1.80-slim-bullseye
environment:
CARGO_NET_GIT_FETCH_WITH_CLI: true
steps:
- checkout
- run:
name: Clippy
command: cargo clippy --all-features --lib -p fred -- -Dwarnings
name: Install build dependencies
command: apt-get update && apt-get install -y build-essential libssl-dev pkg-config git
- run:
name: Install clippy
command: rustup component add clippy
- run:
name: Clippy Tokio features
command: |
cargo clippy --features "i-all i-redis-stack transactions blocking-encoding dns metrics mocks monitor \
replicas sentinel-auth sentinel-client serde-json subscriber-client unix-sockets credential-provider \
enable-rustls enable-native-tls full-tracing" --lib -p fred -- -Dwarnings
- run:
name: Clippy Glommio features
command: |
cargo clippy --features "i-all i-redis-stack transactions blocking-encoding dns metrics mocks monitor \
replicas sentinel-auth sentinel-client serde-json subscriber-client glommio credential-provider \
enable-rustls enable-native-tls full-tracing" --lib -p fred -- -Dwarnings
cargo-fmt:
docker:
- image: cimg/rust:1.78
- image: cimg/rust:1.80
environment:
CARGO_NET_GIT_FETCH_WITH_CLI: true
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
target
Cargo.lock
.idea
.doc
tests/tmp/*
!tests/tmp/.gitkeep
dump.rdb
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 9.2.0

* Add initial support for the [Glommio](https://github.com/DataDog/glommio) runtime
* Add `credential-provider` feature
* Fix pipeline processing in mocks
* Support pipelined transactions

## 9.1.2

* Fix `FT.AGGREGATE` command with `SORTBY` operation
Expand Down
38 changes: 36 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,30 @@ name = "fred"
readme = "README.md"
repository = "https://github.com/aembke/fred.rs"
rust-version = "1.75"
version = "9.1.2"
version = "9.2.0"

[package.metadata.docs.rs]
all-features = true
# do not show the glommio version of the docs
features = [
"i-all",
"i-redis-stack",
"transactions",
"blocking-encoding",
"dns",
"metrics",
"mocks",
"monnitor",
"replicas",
"sentinel-auth",
"sentinel-client",
"serde-json",
"subscriber-client",
"unix-sockets",
"enable-rustls",
"enable-native-tls",
"full-tracing",
"credential-provider"
]
rustdoc-args = ["--cfg", "docsrs"]

[lib]
Expand All @@ -40,6 +60,10 @@ subscriber-client = ["i-pubsub"]
transactions = []
trust-dns-resolver = ["dep:trust-dns-resolver"]
unix-sockets = []
credential-provider = []

# Enable experimental support for the Glommio runtime.
glommio = ["dep:glommio", "futures-io", "pin-project", "fred-macros/enabled", "oneshot", "futures-lite"]

# Enables rustls with the rustls/aws_lc_rs crypto backend
enable-rustls = [
Expand Down Expand Up @@ -170,6 +194,12 @@ trust-dns-resolver = { version = "0.23", optional = true, features = ["tokio"] }
hickory-resolver = { version = "0.24.1", optional = true, features = ["tokio"] }
url = "2.4"
urlencoding = "2.1"
fred-macros = "0.1"
glommio = { version = "0.9.0", optional = true }
futures-io = { version = "0.3", optional = true }
pin-project = { version = "1.1.5", optional = true }
oneshot = { version = "0.1.8", optional = true, features = ["async"] }
futures-lite = { version = "2.3", optional = true }

[dev-dependencies]
axum = { version = "0.7", features = ["macros"] }
Expand All @@ -180,6 +210,10 @@ serde = { version = "1.0", features = ["derive"] }
subprocess = "0.2"
tokio-stream = { version = "0.1", features = ["sync"] }

[[example]]
name = "glommio"
required-features = ["glommio", "i-std"]

[[example]]
name = "misc"
required-features = ["i-all"]
Expand Down
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,31 @@ See the build features for more information.

## Client Features

| Name | Default | Description |
|---------------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `transactions` | x | Enable a [Transaction](https://redis.io/docs/interact/transactions/) interface. |
| `enable-native-tls` | | Enable TLS support via [native-tls](https://crates.io/crates/native-tls). |
| `enable-rustls` | | Enable TLS support via [rustls](https://crates.io/crates/rustls) with the default crypto backend features. |
| `enable-rustls-ring` | | Enable TLS support via [rustls](https://crates.io/crates/rustls) and the ring crypto backend. |
| `vendored-openssl` | | Enable the `native-tls/vendored` feature. |
| `metrics` | | Enable the metrics interface to track overall latency, network latency, and request/response sizes. |
| `full-tracing` | | Enable full [tracing](./src/trace/README.md) support. This can emit a lot of data. |
| `partial-tracing` | | Enable partial [tracing](./src/trace/README.md) support, only emitting traces for top level commands and network latency. |
| `blocking-encoding` | | Use a blocking task for encoding or decoding frames. This can be useful for clients that send or receive large payloads, but requires a multi-thread Tokio runtime. |
| `custom-reconnect-errors` | | Enable an interface for callers to customize the types of errors that should automatically trigger reconnection logic. |
| `monitor` | | Enable an interface for running the `MONITOR` command. |
| `sentinel-client` | | Enable an interface for communicating directly with Sentinel nodes. This is not necessary to use normal Redis clients behind a sentinel layer. |
| `sentinel-auth` | | Enable an interface for using different authentication credentials to sentinel nodes. |
| `subscriber-client` | | Enable a subscriber client interface that manages channel subscription state for callers. |
| `serde-json` | | Enable an interface to automatically convert Redis types to JSON via `serde-json`. |
| `mocks` | | Enable a mocking layer interface that can be used to intercept and process commands in tests. |
| `dns` | | Enable an interface that allows callers to override the DNS lookup logic. |
| `replicas` | | Enable an interface that routes commands to replica nodes. |
| `default-nil-types` | | Enable a looser parsing interface for `nil` values. |
| `sha-1` | | Enable an interface for hashing Lua scripts. |
| `unix-sockets` | | Enable Unix socket support. |
| Name | Default | Description |
|---------------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `transactions` | x | Enable a [Transaction](https://redis.io/docs/interact/transactions/) interface. |
| `enable-native-tls` | | Enable TLS support via [native-tls](https://crates.io/crates/native-tls). |
| `enable-rustls` | | Enable TLS support via [rustls](https://crates.io/crates/rustls) with the default crypto backend features. |
| `enable-rustls-ring` | | Enable TLS support via [rustls](https://crates.io/crates/rustls) and the ring crypto backend. |
| `vendored-openssl` | | Enable the `native-tls/vendored` feature. |
| `metrics` | | Enable the metrics interface to track overall latency, network latency, and request/response sizes. |
| `full-tracing` | | Enable full [tracing](./src/trace/README.md) support. This can emit a lot of data. |
| `partial-tracing` | | Enable partial [tracing](./src/trace/README.md) support, only emitting traces for top level commands and network latency. |
| `blocking-encoding` | | Use a blocking task for encoding or decoding frames. This can be useful for clients that send or receive large payloads, but requires a multi-thread Tokio runtime. |
| `custom-reconnect-errors` | | Enable an interface for callers to customize the types of errors that should automatically trigger reconnection logic. |
| `monitor` | | Enable an interface for running the `MONITOR` command. |
| `sentinel-client` | | Enable an interface for communicating directly with Sentinel nodes. This is not necessary to use normal Redis clients behind a sentinel layer. |
| `sentinel-auth` | | Enable an interface for using different authentication credentials to sentinel nodes. |
| `subscriber-client` | | Enable a subscriber client interface that manages channel subscription state for callers. |
| `serde-json` | | Enable an interface to automatically convert Redis types to JSON via `serde-json`. |
| `mocks` | | Enable a mocking layer interface that can be used to intercept and process commands in tests. |
| `dns` | | Enable an interface that allows callers to override the DNS lookup logic. |
| `replicas` | | Enable an interface that routes commands to replica nodes. |
| `default-nil-types` | | Enable a looser parsing interface for `nil` values. |
| `sha-1` | | Enable an interface for hashing Lua scripts. |
| `unix-sockets` | | Enable Unix socket support. |
| `glommio` | | Enable experimental [Glommio](https://github.com/DataDog/glommio) support. See the [Glommio Runtime](https://github.com/aembke/fred.rs/blob/main/src/glommio/README.md) docs for more information. When enabled the client will no longer work with Tokio runtimes. |
| `credential-provider` | | Enable an interface that can dynamically load auth credentials at runtime. |

## Interface Features

Expand Down
2 changes: 2 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ Examples
the [keyspace notifications](https://redis.io/docs/manual/keyspace-notifications/) interface.
* [Misc](./misc.rs) - Miscellaneous or advanced features.
* [Replicas](./replicas.rs) - Interact with cluster replica nodes via a `RedisPool`.
* [Glommio](./glommio.rs) - Use the [Glommio](https://github.com/DataDog/glommio) runtime.
See [the source docs](../src/glommio/README.md) for more information.

Or see the [tests](../tests/integration) for more examples.
Loading

0 comments on commit 3e6d00a

Please sign in to comment.