Summary
Moon does not implement any of the blocking list commands. Clients using Moon as a Redis-compatible work queue (Sidekiq-style, Celery broker, custom BLPOP consumers) will fail with -ERR unknown command.
Missing commands
Design notes
- Need per-key wait queue. Natural fit: attach an
Option<SmallVec<Waker>> to each list entry in the shard's DashTable.
- On
LPUSH/RPUSH, if the key has waiters, wake the oldest and hand off the element directly (avoid the push + immediate pop round trip).
- Timeout handling: drive off the shard's cached timestamp tick, not per-client timers. Reuse the expiration wheel.
- Cross-shard
BLPOP key1 key2 where keys live on different shards: register waiters on each shard, first to fire wins — requires a shared cancellation token.
- Client state: connection must be marked blocked;
CLIENT UNPAUSE / CLIENT KILL must unblock.
Acceptance criteria
- Consistency test entry (
scripts/test-consistency.sh) comparing output to Redis for: immediate-return case, true-blocking case, timeout case, multi-key case.
- No
.await while holding a shard lock.
- No per-blocked-client allocation on the hot path.
- Works under both
runtime-tokio and runtime-monoio.
References
Summary
Moon does not implement any of the blocking list commands. Clients using Moon as a Redis-compatible work queue (Sidekiq-style, Celery broker, custom
BLPOPconsumers) will fail with-ERR unknown command.Missing commands
BLPOP key [key ...] timeoutBRPOP key [key ...] timeoutBLMOVE src dst LEFT|RIGHT LEFT|RIGHT timeoutBLMPOP timeout numkeys key [key ...] LEFT|RIGHT [COUNT count]BRPOPLPUSH src dst timeout(deprecated in Redis 6.2 but still widely used)Design notes
Option<SmallVec<Waker>>to each list entry in the shard's DashTable.LPUSH/RPUSH, if the key has waiters, wake the oldest and hand off the element directly (avoid the push + immediate pop round trip).BLPOP key1 key2where keys live on different shards: register waiters on each shard, first to fire wins — requires a shared cancellation token.CLIENT UNPAUSE/CLIENT KILLmust unblock.Acceptance criteria
scripts/test-consistency.sh) comparing output to Redis for: immediate-return case, true-blocking case, timeout case, multi-key case..awaitwhile holding a shard lock.runtime-tokioandruntime-monoio.References