armature-redis

Crates.ioarmature-redis
lib.rsarmature-redis
version0.1.1
created_at2025-12-27 00:30:58.747262+00
updated_at2025-12-30 22:25:18.589085+00
descriptionRedis client integration for Armature - connection pooling, pub/sub, and DI-ready
homepagehttps://pegasusheavy.github.io/armature
repositoryhttps://github.com/pegasusheavy/armature
max_upload_size
id2006489
size67,039
Joseph R. Quinn (quinnjr)

documentation

README

armature-redis

Redis client integration for the Armature framework.

Features

  • Connection Pooling - Efficient connection management
  • Async Operations - Non-blocking Redis commands
  • Pub/Sub - Real-time messaging
  • Cluster Support - Redis Cluster mode
  • Streams - Redis Streams for event sourcing

Installation

[dependencies]
armature-redis = "0.1"

Quick Start

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(())
}

Pub/Sub

// Subscribe
let mut subscriber = client.subscribe("channel").await?;
while let Some(message) = subscriber.next().await {
    println!("Received: {:?}", message);
}

// Publish
client.publish("channel", "Hello!").await?;

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt