Expand description
SAL Redis Client
A robust Redis client wrapper for Rust applications that provides connection management, automatic reconnection, and a simple interface for executing Redis commands.
§Features
- Connection Management: Automatic connection handling with lazy initialization
- Reconnection: Automatic reconnection on connection failures
- Builder Pattern: Flexible configuration with authentication support
- Environment Configuration: Support for environment variables
- Thread Safety: Safe to use in multi-threaded applications
- Rhai Integration: Scripting support for Redis operations
§Usage
use sal_redisclient::{execute, get_redis_client};
use redis::cmd;
// Execute a simple SET command
let mut set_cmd = redis::cmd("SET");
set_cmd.arg("my_key").arg("my_value");
let result: redis::RedisResult<()> = execute(&mut set_cmd);
// Get the Redis client directly
let client = get_redis_client()?;
Modules§
- rhai
- Rhai wrappers for Redis client module functions
Structs§
- Redis
Client Wrapper - Redis
Config Builder - Redis connection configuration builder
Functions§
- execute
- get_
redis_ client - reset
- with_
config - Create a new Redis client with custom configuration