diff --git a/docs/source/pipelines.rst b/docs/source/pipelines.rst index 112a7603..39473690 100644 --- a/docs/source/pipelines.rst +++ b/docs/source/pipelines.rst @@ -8,6 +8,18 @@ number of back-and-forth TCP packets between the client and server. Pipelines are quite simple to use: + +.. code-block:: python + + async with await client.pipeline() as pipe: + await pipe.delete('bar') + await pipe.set('bar', 'foo') + await pipe.execute() # needs to be called explicitly + + +Here are more examples: + + .. code-block:: python >>> async def example(client): @@ -114,4 +126,4 @@ which is much easier to read: ... await pipe.set('OUR-SEQUENCE-KEY', next_value) >>> >>> await r.transaction(client_side_incr, 'OUR-SEQUENCE-KEY') - [True] \ No newline at end of file + [True]