Crates.io | redis-actor |
lib.rs | redis-actor |
version | 0.4.0 |
source | src |
created_at | 2020-11-07 11:43:54.409691 |
updated_at | 2020-12-06 15:42:13.345717 |
description | Redis Actor |
homepage | |
repository | |
max_upload_size | |
id | 309611 |
size | 10,884 |
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"
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;