@@ -5485,6 +5485,9 @@ def readonly(self, **kwargs) -> ResponseT:
5485
5485
return self .execute_command ("READONLY" , ** kwargs )
5486
5486
5487
5487
5488
+ AsyncClusterCommands = ClusterCommands
5489
+
5490
+
5488
5491
class FunctionCommands :
5489
5492
"""
5490
5493
Redis Function commands
@@ -5497,7 +5500,7 @@ def function_load(
5497
5500
code : str ,
5498
5501
replace : Optional [bool ] = False ,
5499
5502
description : Optional [str ] = None ,
5500
- ) -> str :
5503
+ ) -> Union [ Awaitable [ str ], str ] :
5501
5504
"""
5502
5505
Load a library to Redis.
5503
5506
:param engine: the name of the execution engine for the library
@@ -5517,15 +5520,15 @@ def function_load(
5517
5520
pieces .append (code )
5518
5521
return self .execute_command ("FUNCTION LOAD" , * pieces )
5519
5522
5520
- def function_delete (self , library : str ) -> str :
5523
+ def function_delete (self , library : str ) -> Union [ Awaitable [ str ], str ] :
5521
5524
"""
5522
5525
Delete the library called ``library`` and all its functions.
5523
5526
5524
5527
For more information check https://redis.io/commands/function-delete
5525
5528
"""
5526
5529
return self .execute_command ("FUNCTION DELETE" , library )
5527
5530
5528
- def function_flush (self , mode : str = "SYNC" ) -> str :
5531
+ def function_flush (self , mode : str = "SYNC" ) -> Union [ Awaitable [ str ], str ] :
5529
5532
"""
5530
5533
Deletes all the libraries.
5531
5534
@@ -5535,7 +5538,7 @@ def function_flush(self, mode: str = "SYNC") -> str:
5535
5538
5536
5539
def function_list (
5537
5540
self , library : Optional [str ] = "*" , withcode : Optional [bool ] = False
5538
- ) -> List :
5541
+ ) -> Union [ Awaitable [ list ], list ] :
5539
5542
"""
5540
5543
Return information about the functions and libraries.
5541
5544
:param library: pecify a pattern for matching library names
@@ -5549,18 +5552,22 @@ def function_list(
5549
5552
5550
5553
def _fcall (
5551
5554
self , command : str , function , numkeys : int , * keys_and_args : Optional [List ]
5552
- ) -> str :
5555
+ ) -> Union [ Awaitable [ str ], str ] :
5553
5556
return self .execute_command (command , function , numkeys , * keys_and_args )
5554
5557
5555
- def fcall (self , function , numkeys : int , * keys_and_args : Optional [List ]) -> str :
5558
+ def fcall (
5559
+ self , function , numkeys : int , * keys_and_args : Optional [List ]
5560
+ ) -> Union [Awaitable [str ], str ]:
5556
5561
"""
5557
5562
Invoke a function.
5558
5563
5559
5564
For more information check https://redis.io/commands/fcall
5560
5565
"""
5561
5566
return self ._fcall ("FCALL" , function , numkeys , * keys_and_args )
5562
5567
5563
- def fcall_ro (self , function , numkeys : int , * keys_and_args : Optional [List ]) -> str :
5568
+ def fcall_ro (
5569
+ self , function , numkeys : int , * keys_and_args : Optional [List ]
5570
+ ) -> Union [Awaitable [str ], str ]:
5564
5571
"""
5565
5572
This is a read-only variant of the FCALL command that cannot
5566
5573
execute commands that modify data.
@@ -5569,7 +5576,7 @@ def fcall_ro(self, function, numkeys: int, *keys_and_args: Optional[List]) -> st
5569
5576
"""
5570
5577
return self ._fcall ("FCALL_RO" , function , numkeys , * keys_and_args )
5571
5578
5572
- def function_dump (self ) -> str :
5579
+ def function_dump (self ) -> Union [ Awaitable [ str ], str ] :
5573
5580
"""
5574
5581
Return the serialized payload of loaded libraries.
5575
5582
@@ -5582,7 +5589,9 @@ def function_dump(self) -> str:
5582
5589
5583
5590
return self .execute_command ("FUNCTION DUMP" , ** options )
5584
5591
5585
- def function_restore (self , payload : str , policy : Optional [str ] = "APPEND" ) -> str :
5592
+ def function_restore (
5593
+ self , payload : str , policy : Optional [str ] = "APPEND"
5594
+ ) -> Union [Awaitable [str ], str ]:
5586
5595
"""
5587
5596
Restore libraries from the serialized ``payload``.
5588
5597
You can use the optional policy argument to provide a policy
@@ -5592,15 +5601,15 @@ def function_restore(self, payload: str, policy: Optional[str] = "APPEND") -> st
5592
5601
"""
5593
5602
return self .execute_command ("FUNCTION RESTORE" , payload , policy )
5594
5603
5595
- def function_kill (self ) -> str :
5604
+ def function_kill (self ) -> Union [ Awaitable [ str ], str ] :
5596
5605
"""
5597
5606
Kill a function that is currently executing.
5598
5607
5599
5608
For more information check https://redis.io/commands/function-kill
5600
5609
"""
5601
5610
return self .execute_command ("FUNCTION KILL" )
5602
5611
5603
- def function_stats (self ) -> list :
5612
+ def function_stats (self ) -> Union [ Awaitable [ list ], list ] :
5604
5613
"""
5605
5614
Return information about the function that's currently running
5606
5615
and information about the available execution engines.
@@ -5610,7 +5619,7 @@ def function_stats(self) -> list:
5610
5619
return self .execute_command ("FUNCTION STATS" )
5611
5620
5612
5621
5613
- AsyncClusterCommands = ClusterCommands
5622
+ AsyncFunctionCommands = FunctionCommands
5614
5623
5615
5624
5616
5625
class DataAccessCommands (
@@ -5671,6 +5680,7 @@ class AsyncCoreCommands(
5671
5680
AsyncModuleCommands ,
5672
5681
AsyncPubSubCommands ,
5673
5682
AsyncScriptCommands ,
5683
+ AsyncFunctionCommands ,
5674
5684
):
5675
5685
"""
5676
5686
A class containing all of the implemented redis commands. This class is
0 commit comments