Skip to content

Commit

Permalink
Merge pull request #132 from jaemk/upgrade_redis
Browse files Browse the repository at this point in the history
upgrade redis and support optional ahash feature
  • Loading branch information
jaemk authored Oct 23, 2022
2 parents d33804a + 0dbf7dc commit f5911dc
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 10 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
## Changed
## Removed

## [0.40.0]
## Added
- Add optional feature flag `redis_ahash` to enable `redis`'s optional `ahash` feature
## Changed
- Update `redis` to `0.22.0`
- Move `tokio`'s `rt-multi-thread` feature from being a default to being optionally enabled by `async_tokio_rt_multi_thread`
- Fix makefile's doc target to match documentation, changed from `make sync` to `make docs`
## Removed

## [0.39.0]
## Added
- Add flush method to ExpiringValueCache
Expand Down
10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cached"
version = "0.39.0"
version = "0.40.0"
authors = ["James Kominick <james@kominick.com>"]
description = "Generic cache implementations and simplified function memoization"
repository = "/~https://github.com/jaemk/cached"
Expand All @@ -18,9 +18,11 @@ all-features = true
default = ["proc_macro", "async"]
proc_macro = ["tokio", "cached_proc_macro", "cached_proc_macro_types"]
async = ["futures", "tokio", "async-trait", "async_once", "lazy_static"]
async_tokio_rt_multi_thread = ["async", "tokio/rt-multi-thread"]
redis_store = ["redis", "r2d2", "serde", "serde_json"]
redis_async_std = ["redis_store", "async", "redis/aio", "redis/async-std-comp", "redis/tls", "redis/async-std-tls-comp"]
redis_tokio = ["redis_store", "async", "redis/aio", "redis/tokio-comp", "redis/tls", "redis/tokio-native-tls-comp"]
redis_ahash = ["redis_store", "redis/ahash"]
wasm = ["instant/wasm-bindgen"]

[dependencies.cached_proc_macro]
Expand Down Expand Up @@ -62,7 +64,7 @@ version = "0.1"
optional = true

[dependencies.redis]
version = "0.21"
version = "0.22"
features = ["r2d2"]
optional = true

Expand All @@ -80,8 +82,8 @@ version = "1.0"
optional = true

[dependencies.tokio]
version = "1.12"
features = ["macros", "time", "sync", "rt-multi-thread"]
version = "1"
features = ["macros", "time", "sync"]
optional = true

[dependencies.instant]
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ docker/status:

################################################################################
# Syncs all docs
sync: sync/readme
docs: docs/readme

# Updates README.md using `README_CC`
sync/readme: README.md
docs/readme: README.md

README.md: src/lib.rs
@echo [$@]: Updating $@...
Expand Down Expand Up @@ -158,7 +158,7 @@ clean/docker/%:
$(filter examples%, $(MAKECMDGOALS)) \
$(filter tests%, $(MAKECMDGOALS)) \
$(filter docker%, $(MAKECMDGOALS)) \
$(filter sync%, $(MAKECMDGOALS)) \
$(filter docs%, $(MAKECMDGOALS)) \
$(filter fmt%, $(MAKECMDGOALS)) \
$(filter check%, $(MAKECMDGOALS)) \
$(filter clean%, $(MAKECMDGOALS))
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ of un-cached arguments, specify `#[cached(sync_writes = true)]` / `#[once(sync_w
- `default`: Include `proc_macro` and `async` features
- `proc_macro`: Include proc macros
- `async`: Include support for async functions and async cache stores
- `async_tokio_rt_multi_thread`: Enable `tokio`'s optional `rt-multi-thread` feature.
- `redis_store`: Include Redis cache store
- `redis_async_std`: Include async Redis support using `async-std` and `async-std` tls support, implies `redis_store` and `async`
- `redis_tokio`: Include async Redis support using `tokio` and `tokio` tls support, implies `redis_store` and `async`
- `wasm`: Enable WASM support. Note that this feature is incompatible with all Redis features (`redis_store`, `redis_async_std`, `redis_tokio`)
- `redis_ahash`: Enable the optional `ahash` feature of `redis`
- `wasm`: Enable WASM support. Note that this feature is incompatible with `tokio`'s multi-thread
runtime (`async_tokio_rt_multi_thread`) and all Redis features (`redis_store`, `redis_async_std`, `redis_tokio`, `redis_ahash`)

The procedural macros (`#[cached]`, `#[once]`, `#[io_cached]`) offer more features, including async support.
See the [`proc_macro`](crate::proc_macro) and [`macros`](crate::macros) modules for more samples, and the
Expand Down
3 changes: 2 additions & 1 deletion examples/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ edition = "2021"

[dependencies.cached]
path ="../.."
features = ["wasm"]
default_features = false
features = ["proc_macro", "wasm"]

[dependencies.web-sys]
version = "0.3"
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ of un-cached arguments, specify `#[cached(sync_writes = true)]` / `#[once(sync_w
- `default`: Include `proc_macro` and `async` features
- `proc_macro`: Include proc macros
- `async`: Include support for async functions and async cache stores
- `async_tokio_rt_multi_thread`: Enable `tokio`'s optional `rt-multi-thread` feature.
- `redis_store`: Include Redis cache store
- `redis_async_std`: Include async Redis support using `async-std` and `async-std` tls support, implies `redis_store` and `async`
- `redis_tokio`: Include async Redis support using `tokio` and `tokio` tls support, implies `redis_store` and `async`
- `wasm`: Enable WASM support. Note that this feature is incompatible with all Redis features (`redis_store`, `redis_async_std`, `redis_tokio`)
- `redis_ahash`: Enable the optional `ahash` feature of `redis`
- `wasm`: Enable WASM support. Note that this feature is incompatible with `tokio`'s multi-thread
runtime (`async_tokio_rt_multi_thread`) and all Redis features (`redis_store`, `redis_async_std`, `redis_tokio`, `redis_ahash`)
The procedural macros (`#[cached]`, `#[once]`, `#[io_cached]`) offer more features, including async support.
See the [`proc_macro`](crate::proc_macro) and [`macros`](crate::macros) modules for more samples, and the
Expand Down

0 comments on commit f5911dc

Please sign in to comment.