0
  G   ˆl–Ãa¾”ªa,je@½q�ÜÅ£�þdufåh¯¼Ó’¶ëÀþÂ‚[Á_‘I|¥ŠìBòŽŠRST½ˆOÁÀ  ×    :orphan:

=========
Copyright
=========

pip and this documentation is:

Copyright Â© 2008-2020 The pip developers (see `AUTHORS.txt <https://github.com/pypa/pip/blob/main/AUTHORS.txt>`_ file). All rights reserved.
  /   ˆ{‹„„-i[D<†ªoZƒ›Ù«Ä490_‘I|¥‰ÓMdœv ©ƒ†ü+=ÄÃ ê    ‹      ½”]oÚ0†ïû+Î|±»äðÕNkOAD3MÓ´;Äj°#ÛÀº_?C˜ ìC«&EÊ‰ýú¼ç9ŽM_¥“~öy:€ÙÝ¦ß�†} â§n1ÍÒf¢·Úˆƒ1Rz__#n6›xÓ��]`6ÃÒ/«:oUîcáat;Æ.€–’‹ðê•¯$j!¿�) ÍÊ;%dkkrt²*Ðãqå,º’[‰"ŒW+9™GB®Ññe]I‡FKWO±ILpïBçF<nÍÛ/kòíø|ç·-£¾„5¯ÔB'Ä›š0ª–p6OªÜh‡óŠë‡x¡
¼ò	ù2ìO¾úr»šQ¥•EBÞõ“ñÍ$I	ó¥¤ÈOkî‚æ–°w–F¨BIqV|ßˆïÕ÷ó	ÓF“J—[U{eôAŠñ57•«y`½¥=V5ñ»nðüI3¦·³Á8K‡³¦%b›âPÝ?laÓ0­=¤ÊÊÜû¸§j,^ë¹«o~~Â¾f«¥' ‚“Ê¿ ]ém6ú˜5ôñ$e^©Ph(;ÄÇå>«¯Óêt¢vxZÐî\w¯ Î/¯ÞþO'íZÚä¿È›n÷ øƒâþèRÜÝ›ëéšÏhh    5   ˆl–Ðz¾”ªe¶¥	@ŠãNÜlJbÑ¿�þBø
³e’6Ì² óÇƒq µÆÅÄ     {
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Pipeline examples\n",
    "\n",
    "This example show quickly how to use pipelines in `redis-py`."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Checking that Redis is running"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import redis \n",
    "\n",
    "r = redis.Redis(decode_responses=True)\n",
    "r.ping()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Simple example"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Creating a pipeline instance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "pipe = r.pipeline()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Adding commands to the pipeline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pipe.set(\"a\", \"a value\")\n",
    "pipe.set(\"b\", \"b value\")\n",
    "\n",
    "pipe.get(\"a\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Executing the pipeline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[True, True, 'a value']"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pipe.execute()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The responses of the three commands are stored in a list. In the above example, the two first boolean indicates that the the `set` commands were successfull and the last element of the list is the result of the `get(\"a\")` comand."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Chained call\n",
    "\n",
    "The same result as above can be obtained in one line of code by chaining the opperations."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[True, True, 'a value']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pipe = r.pipeline()\n",
    "pipe.set(\"a\", \"a value\").set(\"b\", \"b value\").get(\"a\").execute()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Performance comparison\n",
    "\n",
    "Using pipelines can improve performance, for more informations, 