liveBook · Manning

Rpush

As explained in Kubernetes for Developers

The Redis RPUSH command appends one or more values to the right end of a list.

RPUSH appends one or more values to the right end of a Redis list. In a queue, it adds new tasks at the back so workers can process them in arrival order. section 10.1.1

Use RPUSH with a queue-processing pattern:

  • Append tasks with RPUSH to the queue’s right side. section 10.1.1
  • Have workers use BLPOP to remove tasks from the left side and wait when the queue is empty. section 10.1.1
  • Avoid busy waiting because Redis performs the blocking wait. section 10.1.1

Adding background tasks

A Python producer calls r.rpush('queue:task', iterations) for ten calculation tasks, then checks the remaining queue depth with llen. Worker Pods consume those tasks with BLPOP.

How Kubernetes for Developers covers it

How deep it goes
Defines right-end insertion and connects it to FIFO processing, but defers broader command behavior.
Examples
Uses a Python producer to append iteration counts for calculating Pi.
What it assumes
Assumes basic Redis and Python familiarity while explaining queue direction and FIFO behavior.
What you can do after
Apply it via redis-py to enqueue work for blocking Redis queue consumers.
How it connects
Connects Redis lists with FIFO queues, BLPOP, workers, and Kubernetes Deployments.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.