This module provides a flexible wrapper for executing Redis commands using redis-py. It defines a dynamic chip that can execute any Redis method asynchronously, with configurable client settings and error handling.
View source code here: GitHub
Executes a Redis command dynamically using redis-py’s async client.
This chip allows you to execute any Redis command by specifying the method name and its parameters. It validates the method exists on the Redis client before execution and handles errors appropriately.
Refer to redis-py documentation for available commands: redis-py Reference
Field | Type | Description |
---|---|---|
client_settings | Configuration for the Redis async client. | |
method | The Redis method to execute (e.g., 'set', 'get', 'hset'). | |
args | typing.List[typing.Any] | Positional arguments for the method. |
kwargs | typing.Dict[str, typing.Any] | Keyword arguments for the method. |
Field | Type | Description |
---|---|---|
status | typing.Literal['OK', 'CONNECTION_ERROR', 'TIMEOUT', 'METHOD_NOT_FOUND', 'REDIS_ERROR', 'ERROR'] | Status of the request. |
result | typing.Optional[typing.Any] | The result of the Redis command (if successful). |
error_message | typing.Optional[str] | Error message if the command failed. |
© 2025 South Patron LLC. All rights reserved.
AI everywhere.