1.. _aioredis-commands:
2
3:class:`aioredis.Redis` --- Commands Mixins Reference
4=====================================================
5
6.. module:: aioredis.commands
7
8This section contains reference for mixins implementing Redis commands.
9
10Descriptions are taken from ``docstrings`` so may not contain proper markup.
11
12
13.. autoclass:: aioredis.Redis
14   :members:
15
16   :param pool_or_conn: Can be either :class:`~aioredis.RedisConnection`
17      or :class:`~aioredis.ConnectionsPool`.
18   :type pool_or_conn: :class:`~aioredis.abc.AbcConnection`
19
20Generic commands
21----------------
22
23.. autoclass:: GenericCommandsMixin
24   :members:
25
26
27Geo commands
28------------
29
30.. versionadded:: v0.3.0
31
32.. autoclass:: GeoCommandsMixin
33   :members:
34
35Geo commands result wrappers
36~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37
38.. class:: GeoPoint(longitude, latitude)
39
40   Bases: :class:`tuple`
41
42   Named tuple representing result returned by ``GEOPOS`` and ``GEORADIUS``
43   commands.
44
45   :param float longitude: longitude value.
46   :param float latitude: latitude value.
47
48.. class:: GeoMember(member, dist, hash, coord)
49
50   Bases: :class:`tuple`
51
52   Named tuple representing result returned by ``GEORADIUS`` and
53   ``GEORADIUSBYMEMBER`` commands.
54
55   :param member: Value of geo sorted set item;
56   :type member: str or bytes
57
58   :param dist: Distance in units passed to call.
59                :class:`None` if ``with_dist`` was not set
60                in :meth:`~GeoCommandsMixin.georadius` call.
61   :type dist: None or float
62
63   :param hash: Geo-hash represented as number.
64                :class:`None` if ``with_hash``
65                was not in :meth:`~GeoCommandsMixin.georadius` call.
66   :type hash: None or int
67
68   :param coord: Coordinate of geospatial index member.
69                 :class:`None` if ``with_coord`` was not set
70                 in :meth:`~GeoCommandsMixin.georadius` call.
71   :type coord: None or GeoPoint
72
73
74Strings commands
75----------------
76
77.. autoclass:: StringCommandsMixin
78   :members:
79
80Hash commands
81-------------
82
83.. autoclass:: HashCommandsMixin
84   :members:
85
86List commands
87-------------
88
89.. autoclass:: ListCommandsMixin
90   :members:
91
92Set commands
93------------
94
95.. autoclass:: SetCommandsMixin
96   :members:
97
98Sorted Set commands
99-------------------
100
101.. autoclass:: SortedSetCommandsMixin
102   :members:
103
104Server commands
105---------------
106
107.. autoclass:: ServerCommandsMixin
108   :members:
109
110HyperLogLog commands
111--------------------
112
113.. autoclass:: HyperLogLogCommandsMixin
114   :members:
115
116Transaction commands
117--------------------
118
119.. autoclass:: TransactionsCommandsMixin
120   :members:
121
122.. class:: Pipeline(connection, commands_factory=lambda conn: conn)
123
124   Commands pipeline.
125
126   Buffers commands for execution in bulk.
127
128   This class implements `__getattr__` method allowing to call methods
129   on instance created with ``commands_factory``.
130
131   .. deprecated:: v1.3.1
132      ``loop`` argument deprecated for Python 3.8 compatibility.
133
134   :param connection: Redis connection
135   :type connection: aioredis.RedisConnection
136
137   :param callable commands_factory: Commands factory to get methods from.
138
139   .. comethod:: execute(\*, return_exceptions=False)
140
141      Executes all buffered commands and returns result.
142
143      Any exception that is raised by any command is caught and
144      raised later when processing results.
145
146      If ``return_exceptions`` is set to ``True`` then all collected errors
147      are returned in resulting list otherwise single
148      :exc:`aioredis.PipelineError` exception is raised
149      (containing all collected errors).
150
151      :param bool return_exceptions: Raise or return exceptions.
152
153      :raise aioredis.PipelineError: Raised when any command caused error.
154
155.. class:: MultiExec(connection, commands_factory=lambda conn: conn)
156
157   Bases: :class:`~Pipeline`.
158
159   Multi/Exec pipeline wrapper.
160
161   See :class:`~Pipeline` for parameters description.
162
163   .. deprecated:: v1.3.1
164      ``loop`` argument deprecated for Python 3.8 compatibility.
165
166   .. comethod:: execute(\*, return_exceptions=False)
167
168      Executes all buffered commands and returns result.
169
170      see :meth:`Pipeline.execute` for details.
171
172      :param bool return_exceptions: Raise or return exceptions.
173
174      :raise aioredis.MultiExecError: Raised instead of :exc:`aioredis.PipelineError`
175      :raise aioredis.WatchVariableError: If watched variable is changed
176
177Scripting commands
178------------------
179
180.. autoclass:: ScriptingCommandsMixin
181   :members:
182
183Server commands
184---------------
185
186.. autoclass:: ServerCommandsMixin
187   :members:
188
189
190Pub/Sub commands
191----------------
192
193Also see :ref:`aioredis.Channel<aioredis-channel>`.
194
195.. autoclass:: PubSubCommandsMixin
196   :members:
197
198
199Cluster commands
200----------------
201
202.. warning::
203   Current release (|release|) of the library **does not support**
204   `Redis Cluster`_ in a full manner.
205   It provides only several API methods which may be changed in future.
206
207.. _Redis Cluster: http://redis.io/topics/cluster-tutorial
208
209.. ::
210   .. autoclass:: ClusterCommandsMixin
211      :members:
212
213
214Streams commands
215----------------
216
217.. autoclass:: StreamCommandsMixin
218   :members:
219