Shared remote cache upload worker for spider and chromey.
This crate provides a high-performance, concurrent batch upload worker
for sending cached HTTP responses to a remote hybrid_cache_server.
Client injection
Call [set_client] at startup to share your application's
reqwest::Client — this avoids compiling a second TLS stack and
reuses the existing connection pool. If never called, a minimal
default client is created on first use.
Features
- Batch-drain: Collects pending jobs from the channel before uploading
- Concurrent uploads: Configurable parallelism via semaphore (default 8)
- Lock-free dedup: DashSet for in-flight key tracking (no Mutex, no deadlocks)
- Rate limiting: Per-spawn pacing without blocking the drain loop
- Batch POST: Uses
/cache/index/batchwhen multiple jobs are ready - Best-effort:
try_enqueuenever blocks; drops on full queue