Skip to content

Commit

Permalink
5.0.0-beta.1 (#35)
Browse files Browse the repository at this point in the history
* See changelog.
  • Loading branch information
aembke authored Mar 14, 2022
1 parent 93ddcad commit f20c0a5
Show file tree
Hide file tree
Showing 144 changed files with 15,717 additions and 9,224 deletions.
2 changes: 2 additions & 0 deletions .circleci/Dockerfile.sentinel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ARG REDIS_VERSION
ARG REDIS_USERNAME
ARG REDIS_PASSWORD
ARG REDIS_SENTINEL_PASSWORD
ARG FRED_CI_NEXTEST

# try to make the new container look like the host
WORKDIR /home/circleci/project
Expand All @@ -25,5 +26,6 @@ RUN .circleci/install_redis_cli.sh

# For debugging
RUN cargo --version && rustc --version
RUN cargo install cargo-nextest

CMD tests/runners/sentinel-features.sh
23 changes: 22 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
- run:
name: Install redis cluster
command: tests/scripts/install_redis_clustered.sh
- run:
name: Install cargo-nextest
command: tests/scripts/install_cargo_nextest.sh
- run:
name: Clear the cargo git cache
command: rm -rf ~/.cargo/git/* && rm -rf ~/.cargo/registry/cache/*
Expand All @@ -34,6 +37,9 @@ jobs:
- run:
name: Install redis cluster
command: tests/scripts/install_redis_clustered.sh
- run:
name: Install cargo-nextest
command: tests/scripts/install_cargo_nextest.sh
- run:
name: Clear the cargo git cache
command: rm -rf ~/.cargo/git/* && rm -rf ~/.cargo/registry/cache/*
Expand All @@ -51,6 +57,9 @@ jobs:
- run:
name: Install redis cluster
command: tests/scripts/install_redis_clustered.sh
- run:
name: Install cargo-nextest
command: tests/scripts/install_cargo_nextest.sh
- run:
name: Clear the cargo git cache
command: rm -rf ~/.cargo/git/* && rm -rf ~/.cargo/registry/cache/*
Expand All @@ -74,6 +83,17 @@ jobs:
- run:
name: Install and run sentinel tests
command: docker-compose -f tests/sentinel-docker-compose.yml -f .circleci/sentinel-compose.yml run sentinel-tests
test-docs:
docker:
- image: cimg/rust:1.57.0
steps:
- checkout
- run:
name: Install nightly
command: rustup install nightly
- run:
name: Build documentation
command: tests/doc.sh

workflows:
version: 2
Expand All @@ -82,4 +102,5 @@ workflows:
- test-default
- test-all-features
- test-no-features
- test-sentinel
- test-sentinel
- test-docs
4 changes: 3 additions & 1 deletion .circleci/sentinel-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ services:
REDIS_USERNAME: "${REDIS_USERNAME}"
REDIS_PASSWORD: "${REDIS_PASSWORD}"
REDIS_SENTINEL_PASSWORD: "${REDIS_SENTINEL_PASSWORD}"
FRED_CI_NEXTEST: "${FRED_CI_NEXTEST}"
networks:
- app-tier
environment:
CIRCLECI_TESTS: "1"
REDIS_VERSION: "${REDIS_VERSION}"
REDIS_USERNAME: "${REDIS_USERNAME}"
REDIS_PASSWORD: "${REDIS_PASSWORD}"
REDIS_SENTINEL_PASSWORD: "${REDIS_SENTINEL_PASSWORD}"
REDIS_SENTINEL_PASSWORD: "${REDIS_SENTINEL_PASSWORD}"
FRED_CI_NEXTEST: "${FRED_CI_NEXTEST}"
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
TLDR
====

* Versions 3.x were focused on upgrading to Tokio 1.x and async/await
* Versions 4.x were focused on ergonomics and testing
* Versions 5.x are focused on feature parity with newer Redis features (streams, RESP3, etc)
* Versions 6.x will be focused on performance.

## 5.0.0-beta.1

* Rewrite the [protocol parser](https://github.com/aembke/redis-protocol.rs) so it can decode frames without moving or copying the underlying bytes
* Change most command implementations to avoid unnecessary allocations when using static str slices
* Rewrite the public interface to use different traits for different parts of the redis interface
* Relax some restrictions on certain commands being used in a transaction
* Implement the Streams interface (XADD, XREAD, etc)
* RESP3 support
* Minor perf improvements via the removal of some locks...
* Minor perf regressions from workarounds required to use [async functions with traits](https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/). In the end it's a wash.
* Move most perf configuration options from `globals` to client-specific config structs
* Add backpressure configuration options to the client config struct
* Fix bugs that can occur when using non-UTF8 byte arrays as keys
* Add the `serde-json` feature
* Handle more complicated failure modes with Redis clusters
* Add a more robust and specialized pubsub subscriber client
* Ergonomics improvements on the public interfaces
* Improve docs
* More tests

## 4.3.2

* Fix https://github.com/aembke/fred.rs/issues/27
Expand Down
207 changes: 94 additions & 113 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

43 changes: 31 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fred"
version = "4.3.2"
version = "5.0.0-beta.1"
authors = ["Alec Embke <[email protected]>"]
edition = "2018"
description = "An async Redis client for Rust built on Futures and Tokio."
Expand All @@ -16,32 +16,37 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
arcstr = "1.1"
arc-swap = "1.5"
tokio = { version = "1", features = ["full"] }
bytes = "1.0"
tokio-util = { version = "0.6", features = ["codec"] }
cfg-if = "1.0.0"
bytes = "1.1"
bytes-utils = "0.1"
futures = "0.3"
parking_lot = "0.11"
lazy_static = "1.4"
redis-protocol = "3.0"
redis-protocol = { version = "4.0", features = ["decode-mut"] }
log = "0.4"
pretty_env_logger = "0.4"
float-cmp = "0.8"
url = "2.2"
native-tls = { version = "0.2", optional = true }
tokio-native-tls = { version = "0.3", optional = true }
rand = "0.8"
tokio-util = { version = "0.6", features = ["codec"] }
tokio-stream = "0.1"
indexmap = { version = "1.7", optional = true }
sha-1 = "0.9"
tracing = { version = "0.1", optional = true }
tracing-futures = { version = "0.2", optional = true }
rand = "0.8"
async-trait = "0.1"
semver = "1.0"
native-tls = { version = "0.2", optional = true }
tokio-native-tls = { version = "0.3", optional = true }
tracing = { version = "0.1", optional = true }
tracing-futures = { version = "0.2", optional = true }
nom = { version = "6.1", optional = true }
serde_json = { version = "1", optional = true }

[dev-dependencies]
prometheus = "0.12"
subprocess = "0.2.7"
maplit = "1.0"

[lib]
doc = true
Expand All @@ -60,15 +65,29 @@ required-features = ["partial-tracing"]
name = "monitor"
required-features = ["monitor"]

[[example]]
name = "prometheus"
required-features = ["metrics"]

[[example]]
name = "pubsub"
required-features = ["subscriber-client"]

[[example]]
name = "serde"
required-features = ["serde-json"]

[features]
default = ["ignore-auth-error", "pool-prefer-active", "enable-tls", "metrics"]
default = ["ignore-auth-error", "pool-prefer-active", "enable-tls"]
fallback = []
serde-json = ["serde_json"]
subscriber-client = []
metrics = []
ignore-auth-error = []
enable-tls = ["native-tls", "tokio-native-tls"]
vendored-tls = ["enable-tls", "native-tls/vendored"]
mocks = []
reconnect-on-auth-error = []
index-map = ["indexmap"]
pool-prefer-active = []
full-tracing = ["partial-tracing", "tracing", "tracing-futures"]
partial-tracing = ["tracing", "tracing-futures"]
Expand Down
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
SHELL := /bin/bash

.PHONY: clean install test-all-features test-default-features test-no-features test-sentinel test-all test

clean:
rm -rf tests/tmp/redis* && cargo clean

install:
source tests/environ && tests/scripts/full_install.sh

test-all-features:
source tests/environ && tests/runners/all-features.sh

test-default-features:
source tests/environ && tests/runners/default-features.sh

test-no-features:
source tests/environ && tests/runners/no-features.sh

test-sentinel:
source tests/environ && tests/runners/sentinel-features.sh

test-all:
source tests/environ && tests/runners/everything.sh

test: test-default-features
Loading

0 comments on commit f20c0a5

Please sign in to comment.