| Crates.io | armature-redis |
| lib.rs | armature-redis |
| version | 0.1.1 |
| created_at | 2025-12-27 00:30:58.747262+00 |
| updated_at | 2025-12-30 22:25:18.589085+00 |
| description | Redis client integration for Armature - connection pooling, pub/sub, and DI-ready |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006489 |
| size | 67,039 |
Redis client integration for the Armature framework.
[dependencies]
armature-redis = "0.1"
use armature_redis::RedisClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = RedisClient::new("redis://localhost:6379").await?;
// Basic operations
client.set("key", "value").await?;
let value: String = client.get("key").await?;
// With expiration
client.set_ex("temp_key", "value", 60).await?;
Ok(())
}
// Subscribe
let mut subscriber = client.subscribe("channel").await?;
while let Some(message) = subscriber.next().await {
println!("Received: {:?}", message);
}
// Publish
client.publish("channel", "Hello!").await?;
MIT OR Apache-2.0