@@ -517,6 +517,7 @@ def client_list(
517
517
"""
518
518
Returns a list of currently connected clients.
519
519
If type of client specified, only that type will be returned.
520
+
520
521
:param _type: optional. one of the client types (normal, master,
521
522
replica, pubsub)
522
523
:param client_id: optional. a list of client ids
@@ -559,16 +560,17 @@ def client_reply(
559
560
) -> ResponseT :
560
561
"""
561
562
Enable and disable redis server replies.
563
+
562
564
``reply`` Must be ON OFF or SKIP,
563
- ON - The default most with server replies to commands
564
- OFF - Disable server responses to commands
565
- SKIP - Skip the response of the immediately following command.
565
+ ON - The default most with server replies to commands
566
+ OFF - Disable server responses to commands
567
+ SKIP - Skip the response of the immediately following command.
566
568
567
569
Note: When setting OFF or SKIP replies, you will need a client object
568
570
with a timeout specified in seconds, and will need to catch the
569
571
TimeoutError.
570
- The test_client_reply unit test illustrates this, and
571
- conftest.py has a client with a timeout.
572
+ The test_client_reply unit test illustrates this, and
573
+ conftest.py has a client with a timeout.
572
574
573
575
See https://redis.io/commands/client-reply
574
576
"""
@@ -724,19 +726,21 @@ def client_unblock(
724
726
725
727
def client_pause (self , timeout : int , all : bool = True , ** kwargs ) -> ResponseT :
726
728
"""
727
- Suspend all the Redis clients for the specified amount of time
728
- :param timeout: milliseconds to pause clients
729
+ Suspend all the Redis clients for the specified amount of time.
730
+
729
731
730
732
For more information see https://redis.io/commands/client-pause
733
+
734
+ :param timeout: milliseconds to pause clients
731
735
:param all: If true (default) all client commands are blocked.
732
- otherwise, clients are only blocked if they attempt to execute
733
- a write command.
734
- For the WRITE mode, some commands have special behavior:
735
- EVAL/EVALSHA: Will block client for all scripts.
736
- PUBLISH: Will block client.
737
- PFCOUNT: Will block client.
738
- WAIT: Acknowledgments will be delayed, so this command will
739
- appear blocked.
736
+ otherwise, clients are only blocked if they attempt to execute
737
+ a write command.
738
+ For the WRITE mode, some commands have special behavior:
739
+ EVAL/EVALSHA: Will block client for all scripts.
740
+ PUBLISH: Will block client.
741
+ PFCOUNT: Will block client.
742
+ WAIT: Acknowledgments will be delayed, so this command will
743
+ appear blocked.
740
744
"""
741
745
args = ["CLIENT PAUSE" , str (timeout )]
742
746
if not isinstance (timeout , int ):
@@ -1215,9 +1219,11 @@ def quit(self, **kwargs) -> ResponseT:
1215
1219
def replicaof (self , * args , ** kwargs ) -> ResponseT :
1216
1220
"""
1217
1221
Update the replication settings of a redis replica, on the fly.
1222
+
1218
1223
Examples of valid arguments include:
1219
- NO ONE (set no replication)
1220
- host port (set to the host and port of a redis server)
1224
+
1225
+ NO ONE (set no replication)
1226
+ host port (set to the host and port of a redis server)
1221
1227
1222
1228
For more information see https://redis.io/commands/replicaof
1223
1229
"""
@@ -3603,27 +3609,37 @@ def xclaim(
3603
3609
) -> ResponseT :
3604
3610
"""
3605
3611
Changes the ownership of a pending message.
3612
+
3606
3613
name: name of the stream.
3614
+
3607
3615
groupname: name of the consumer group.
3616
+
3608
3617
consumername: name of a consumer that claims the message.
3618
+
3609
3619
min_idle_time: filter messages that were idle less than this amount of
3610
3620
milliseconds
3621
+
3611
3622
message_ids: non-empty list or tuple of message IDs to claim
3623
+
3612
3624
idle: optional. Set the idle time (last time it was delivered) of the
3613
- message in ms
3625
+ message in ms
3626
+
3614
3627
time: optional integer. This is the same as idle but instead of a
3615
- relative amount of milliseconds, it sets the idle time to a specific
3616
- Unix time (in milliseconds).
3628
+ relative amount of milliseconds, it sets the idle time to a specific
3629
+ Unix time (in milliseconds).
3630
+
3617
3631
retrycount: optional integer. set the retry counter to the specified
3618
- value. This counter is incremented every time a message is delivered
3619
- again.
3632
+ value. This counter is incremented every time a message is delivered
3633
+ again.
3634
+
3620
3635
force: optional boolean, false by default. Creates the pending message
3621
- entry in the PEL even if certain specified IDs are not already in the
3622
- PEL assigned to a different client.
3636
+ entry in the PEL even if certain specified IDs are not already in the
3637
+ PEL assigned to a different client.
3638
+
3623
3639
justid: optional boolean, false by default. Return just an array of IDs
3624
- of messages successfully claimed, without returning the actual message
3640
+ of messages successfully claimed, without returning the actual message
3625
3641
3626
- For more information see https://redis.io/commands/xclaim
3642
+ For more information see https://redis.io/commands/xclaim
3627
3643
"""
3628
3644
if not isinstance (min_idle_time , int ) or min_idle_time < 0 :
3629
3645
raise DataError ("XCLAIM min_idle_time must be a non negative integer" )
@@ -3875,11 +3891,15 @@ def xrange(
3875
3891
) -> ResponseT :
3876
3892
"""
3877
3893
Read stream values within an interval.
3894
+
3878
3895
name: name of the stream.
3896
+
3879
3897
start: first stream ID. defaults to '-',
3880
3898
meaning the earliest available.
3899
+
3881
3900
finish: last stream ID. defaults to '+',
3882
3901
meaning the latest available.
3902
+
3883
3903
count: if set, only return this many items, beginning with the
3884
3904
earliest available.
3885
3905
@@ -3902,10 +3922,13 @@ def xread(
3902
3922
) -> ResponseT :
3903
3923
"""
3904
3924
Block and monitor multiple streams for new data.
3925
+
3905
3926
streams: a dict of stream names to stream IDs, where
3906
3927
IDs indicate the last ID already seen.
3928
+
3907
3929
count: if set, only return this many items, beginning with the
3908
3930
earliest available.
3931
+
3909
3932
block: number of milliseconds to wait, if nothing already present.
3910
3933
3911
3934
For more information see https://redis.io/commands/xread
@@ -3940,12 +3963,17 @@ def xreadgroup(
3940
3963
) -> ResponseT :
3941
3964
"""
3942
3965
Read from a stream via a consumer group.
3966
+
3943
3967
groupname: name of the consumer group.
3968
+
3944
3969
consumername: name of the requesting consumer.
3970
+
3945
3971
streams: a dict of stream names to stream IDs, where
3946
3972
IDs indicate the last ID already seen.
3973
+
3947
3974
count: if set, only return this many items, beginning with the
3948
3975
earliest available.
3976
+
3949
3977
block: number of milliseconds to wait, if nothing already present.
3950
3978
noack: do not add messages to the PEL
3951
3979
@@ -3980,11 +4008,15 @@ def xrevrange(
3980
4008
) -> ResponseT :
3981
4009
"""
3982
4010
Read stream values within an interval, in reverse order.
4011
+
3983
4012
name: name of the stream
4013
+
3984
4014
start: first stream ID. defaults to '+',
3985
4015
meaning the latest available.
4016
+
3986
4017
finish: last stream ID. defaults to '-',
3987
4018
meaning the earliest available.
4019
+
3988
4020
count: if set, only return this many items, beginning with the
3989
4021
latest available.
3990
4022
@@ -5301,8 +5333,10 @@ def script_flush(
5301
5333
self , sync_type : Union [Literal ["SYNC" ], Literal ["ASYNC" ]] = None
5302
5334
) -> ResponseT :
5303
5335
"""Flush all scripts from the script cache.
5336
+
5304
5337
``sync_type`` is by default SYNC (synchronous) but it can also be
5305
5338
ASYNC.
5339
+
5306
5340
For more information see https://redis.io/commands/script-flush
5307
5341
"""
5308
5342
@@ -5615,11 +5649,14 @@ def geosearch(
5615
5649
area specified by a given shape. This command extends the
5616
5650
GEORADIUS command, so in addition to searching within circular
5617
5651
areas, it supports searching within rectangular areas.
5652
+
5618
5653
This command should be used in place of the deprecated
5619
5654
GEORADIUS and GEORADIUSBYMEMBER commands.
5655
+
5620
5656
``member`` Use the position of the given existing
5621
5657
member in the sorted set. Can't be given with ``longitude``
5622
5658
and ``latitude``.
5659
+
5623
5660
``longitude`` and ``latitude`` Use the position given by
5624
5661
this coordinates. Can't be given with ``member``
5625
5662
``radius`` Similar to GEORADIUS, search inside circular
@@ -5628,17 +5665,23 @@ def geosearch(
5628
5665
``height`` and ``width`` Search inside an axis-aligned
5629
5666
rectangle, determined by the given height and width.
5630
5667
Can't be given with ``radius``
5668
+
5631
5669
``unit`` must be one of the following : m, km, mi, ft.
5632
5670
`m` for meters (the default value), `km` for kilometers,
5633
5671
`mi` for miles and `ft` for feet.
5672
+
5634
5673
``sort`` indicates to return the places in a sorted way,
5635
5674
ASC for nearest to furthest and DESC for furthest to nearest.
5675
+
5636
5676
``count`` limit the results to the first count matching items.
5677
+
5637
5678
``any`` is set to True, the command will return as soon as
5638
5679
enough matches are found. Can't be provided without ``count``
5680
+
5639
5681
``withdist`` indicates to return the distances of each place.
5640
5682
``withcoord`` indicates to return the latitude and longitude of
5641
5683
each place.
5684
+
5642
5685
``withhash`` indicates to return the geohash string of each place.
5643
5686
5644
5687
For more information see https://redis.io/commands/geosearch
0 commit comments