Crate apalis_redis
source ·Expand description
apalis storage using Redis as a backend
use apalis::prelude::*;
use apalis::redis::RedisStorage;
use email_service::send_email;
#[tokio::main]
async fn main() {
let conn = apalis::redis::connect("redis://127.0.0.1/").await.unwrap();
let storage = RedisStorage::new(conn);
Monitor::<TokioExecutor>::new()
.register(
WorkerBuilder::new("tasty-pear")
.source(storage.clone())
.build_fn(send_email),
)
.run()
.await
.unwrap();
}
Structs§
- Config for a RedisStorage
- Represents a Storage that uses Redis for storage.
Functions§
- Shorthand to create a client and connect