feat(wfe-valkey): add Valkey provider for locks, queues, and lifecycle events

ValkeyLockProvider: SET NX EX for acquisition, Lua script for safe release.
ValkeyQueueProvider: LPUSH/RPOP for FIFO queues.
ValkeyLifecyclePublisher: PUBLISH to per-instance and global channels.

Connections obtained once during construction (no per-operation TCP handshakes).
This commit is contained in:
2026-03-25 20:14:07 +00:00
parent b2c37701b1
commit f95bef3883
8 changed files with 388 additions and 0 deletions

8
wfe-valkey/tests/lock.rs Normal file
View File

@@ -0,0 +1,8 @@
use wfe_core::lock_suite;
async fn make_provider() -> wfe_valkey::ValkeyLockProvider {
let prefix = format!("wfe_test_{}", uuid::Uuid::new_v4().simple());
wfe_valkey::ValkeyLockProvider::new("redis://localhost:6379", &prefix).await.unwrap()
}
lock_suite!(make_provider);