Challenge 1: Build a Simple Queue — Possible Solution ==================================================================== Producer: 127.0.0.1:6379> RPUSH image-jobs "resize-image:1" (integer) 1 127.0.0.1:6379> RPUSH image-jobs "resize-image:2" (integer) 2 Worker: 127.0.0.1:6379> BLPOP image-jobs 0 1) "image-jobs" 2) "resize-image:1" WHY THIS WORKS AS AN ANSWER ------------------------------ Both RPUSH calls append to the TAIL of the list in the order called, giving image-jobs the contents ["resize-image:1", "resize-image:2"] — the first job pushed ends up at the front (head) of the list, per Chapter 3's ordering rules. BLPOP image-jobs 0 blocks (waits) until an element is available at the HEAD of the list, then pops and returns it — since resize-image:1 is at the head (pushed first), it's the one delivered to this worker first, following standard first-in-first-out queue order. The 0 argument means "wait indefinitely" rather than timing out after a fixed number of seconds. A second call to BLPOP image-jobs 0 from another worker (or the same one again) would then receive resize-image:2, since the first job was already removed from the list by the previous BLPOP.