{
  "schema_version": 2,
  "id": "commands/brpop",
  "title": "BRPOP",
  "url": "https://redis.io/docs/latest/commands/brpop/",
  "summary": "Removes and returns the last element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped.",
  "since": "2.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:47:41+01:00",
  "page_type": "content",
  "content_hash": "25ac4abd958600f5ab030f30e2d4176934d268ba5786e7d4e8de29919fad2fcc",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "> [!NOTE]\n> This command's behavior varies in clustered Redis environments. See the [multi-key operations](https://redis.io/docs/latest/develop/using-commands/multi-key-operations) page for more information.\n\n\n`BRPOP` is a blocking list pop primitive.\nIt is the blocking version of [`RPOP`](https://redis.io/docs/latest/commands/rpop) because it blocks the connection when there\nare no elements to pop from any of the given lists.\nAn element is popped from the tail of the first list that is non-empty, with the\ngiven keys being checked in the order that they are given.\n\nSee the [BLPOP documentation](https://redis.io/docs/latest/commands/blpop) for the exact semantics, since `BRPOP` is\nidentical to [`BLPOP`](https://redis.io/docs/latest/commands/blpop) with the only difference being that it pops elements from\nthe tail of a list instead of popping from the head."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key [key ...]</code></summary>\n\nOne or more keys of lists to operate on.\n\n</details>\n\n<details open><summary><code>timeout</code></summary>\n\nThe maximum time to block, in seconds. A timeout of `0` blocks indefinitely.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "[code example]"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Nil reply](../../develop/reference/protocol-spec#bulk-strings): no element could be popped and the timeout expired.\n* [Array reply](../../develop/reference/protocol-spec#arrays): the key from which the element was popped and the value of the popped element\n\n**RESP3:**\n\nOne of the following:\n* [Null reply](../../develop/reference/protocol-spec#nulls): no element could be popped and the timeout expired.\n* [Array reply](../../develop/reference/protocol-spec#arrays): the key from which the element was popped and the value of the popped element"
    }
  ],
  "examples": [
    {
      "id": "examples-ex0",
      "language": "plaintext",
      "code": "redis> DEL list1 list2\n(integer) 0\nredis> RPUSH list1 a b c\n(integer) 3\nredis> BRPOP list1 list2 0\n1) \"list1\"\n2) \"c\"",
      "section_id": "examples"
    }
  ]
}
