Expand description
apalis storage using Redis as a backend
use apalis::prelude::*;
use apalis_redis::{RedisStorage, Config};
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::new()
.register(
WorkerBuilder::new("tasty-pear")
.backend(storage.clone())
.build_fn(send_email),
)
.run()
.await
.unwrap();
}
Structs§
- Config for a RedisStorage
- The context for a redis storage job
- Represents redis key names for various components of the RedisStorage.
- Represents a Storage that uses Redis for storage.
Enums§
- Errors that can occur while polling a Redis backend.
Functions§
- Shorthand to create a client and connect