Cache adapter
Redis-backed adapter exposing pub/sub, FIFO list, cache, sorted-set and BullMQ capabilities.
BullMQ
Off by default. Enable the feature:
= { = "0.4.1", = ["bullmq"] }
use Cache;
use ;
let bull = new.bullmq.await?;
bull.enqueue
.await?;
Jobs are written by BullMQ's own Lua scripts, in BullMQ's own key layout, so a Node, Python, PHP or Elixir BullMQ worker consumes them unchanged and Bull Board sees the queues as normal. The enqueue above produces exactly:
bull:ksef-gpt:id bull:ksef-gpt:wait bull:ksef-gpt:meta
bull:ksef-gpt:events bull:ksef-gpt:marker bull:ksef-gpt:1 (the job hash)
Capabilities
Producing: enqueue, enqueue_bulk. Job options: delay, priority, attempts with
fixed or exponential backoff, remove_on_complete / remove_on_fail, custom job
ids, deduplication.
Inspecting: job_counts, get_job, list_jobs (waiting / active / delayed /
prioritized / completed / failed), pause, resume, is_paused, obliterate.
Consuming jobs (a Worker), queue events, flows and scheduled jobs are not yet
implemented — see docs/superpowers/specs/2026-08-25-bullmq-support-design.md.
Queue names
QueueChannel mirrors the existing ListChannel / CacheSpace pattern, with
Custom(String) for queues not worth a crate release. Names are lowercase-kebab
(ksef-gpt, bajkomat-api) because they appear in dashboards and must match any
non-Rust consumer exactly.
Custom is an escape hatch, not a dynamic namespace: the provider caches one
connection pool per distinct queue name and never evicts, so minting a fresh name
per request or per tenant would accumulate pools without bound.
Configuration
| Variable | Purpose | Default |
|---|---|---|
FLIPPICO_CACHE_REDIS_URL |
Redis connection, shared with all other capabilities | required |
FLIPPICO_CACHE_BULLMQ_PREFIX |
BullMQ key prefix | bull |
Keep the prefix at bull unless you need isolation — it is what BullMQ tooling
expects.
Notes
Cache::bullmq()isasync, unlike the other four builders. BullMQ's job lifecycle cannot be driven from a blocking call, andblock_oninside an existing Tokio runtime panics.- Every BullMQ method returns a
Result. The older sync traits log and return(); for a queue that would be silent data loss. - Enabling this feature links a second major version of the
rediscrate (1.6.0, required bybullmq-official) alongside this crate's0.32.5. Both compile and coexist correctly; it costs build time and binary size. bullmq-officialis pinned to an exact version (=1.2.6). Upgrade deliberately, not via a caret range.
Testing
Integration tests need a Redis and skip cleanly, with a printed notice, when none is listening:
Override the target with FLIPPICO_CACHE_TEST_REDIS_URL. These tests never read
FLIPPICO_CACHE_REDIS_URL, so they cannot touch a production server.
⚠️ The pre-existing tests inside
src/lib.rs(fifo_test,publish_test,cache_test_set,cache_test_del) do readFLIPPICO_CACHE_REDIS_URLand will read and write against whatever server.envpoints at. Scope test runs to--test bullmq_producerunless you intend that.