redis-actor

Crates.ioredis-actor
lib.rsredis-actor
version0.4.0
sourcesrc
created_at2020-11-07 11:43:54.409691
updated_at2020-12-06 15:42:13.345717
descriptionRedis Actor
homepage
repository
max_upload_size
id309611
size10,884
Cheng JIANG (GopherJ)

documentation

README

redis-actor

Installation

Add this package to Cargo.toml of your project. (Check https://crates.io/crates/redis-actor for right version)

[dependencies]
actix = "0.9.0"
redis-actor = "0.2.0"

Features

  • built-in connection pool
  • reconnecting

Get started

use actix::{Arbiter, Addr, Supervisor};
use redis_actor::{RedisActor, RedisCmd, bb8_redis::redis::RedisResult};

let arb = Arbiter::new();
let redis_url = "http://127.0.0.1:6379/0"

let addr: Addr<RedisActor> = Supervisor::start_in_arbiter(
        &arb,
        move |_| RedisActor::new(redis_url).unwrap()
);

addr.send(RedisCmd::<String>::Set("hello".to_owned(), " world!".to_owned()).await;
Commit count: 0

cargo fmt