HydraCache 0.26.0
HydraCache 0.26.0
Status: published.
0.26.0 is a hot-path and allocation hardening release. After the 0.25.0
owner-side loading work, the next step is to make sure optional listeners and
diagnostics do not add unnecessary allocation cost to ordinary local cache
operations.
Highlights
- Added internal event-publication preflight before owned
CacheEvent
construction. - Made key, tag, cache, and single-flight event construction lazy on
unobserved paths. - Kept listener APIs source-compatible.
- Added focused tests for subscriber and no-subscriber behavior.
- Added allocation/performance smoke coverage for event publication modes.
- Added
POST /demo/events/preflight/runto explain event preflight behavior
in the sandbox and Swagger/OpenAPI lab. - Added README, rustdoc, and testing-doc examples for the listener cost model.
Intended Shape
Applications should keep using the same listener API:
use hydracache::{CacheEventKind, CacheOptions, HydraCache};
# async fn example() -> hydracache::CacheResult<()> {
let cache = HydraCache::local().build();
let mut events = cache.subscribe_mutations();
cache
.put("user:42", "Ada".to_owned(), CacheOptions::new().tag("users"))
.await?;
let event = events.recv().await.expect("event");
assert_eq!(event.kind(), CacheEventKind::Stored);
# Ok(())
# }The release changes the internal cost model, not the public behavior: when no
subscriber exists, HydraCache skips building the owned event payload. Access
events still need both subscribe_access() and enable_access_events(true).
The sandbox route reports four scenarios:
- no subscriber: attempted cache operations publish zero events;
- mutation subscriber: mutation events are observed and counted;
- access subscriber with access events disabled: hit/miss streams stay silent;
- access subscriber with access events enabled: access events are observed.
Validation
Focused checks:
cargo test -p hydracache --lib --locked events::tests::preflight
cargo test -p hydracache --lib --locked cache::tests::lazy
cargo test -p hydracache --test performance_smoke --locked event_preflight
cargo test -p hydracache-sandbox --locked swagger_api_exercises_library_features_and_reports
cargo test --doc -p hydracache --lockedExpected full release gate:
cargo fmt --all -- --check
cargo check --workspace --all-targets --locked
cargo test --workspace --locked
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --doc --workspace --locked
$env:RUSTDOCFLAGS='-D warnings'; cargo doc --workspace --no-deps --lockedSee
the 0.26.0 plan
for the implementation checklist.