#![allow(unused)]
use arifa::prelude::*;
use std::sync::Arc;
#[derive(Clone)]
pub struct AppState {
pub node_id: String,
pub arifa: Arc<Arifa>,
}
impl AppState {
pub async fn new<T: Into<String>>(node_id: T, redis_url: &str) -> Self {
let node_id: String = node_id.into();
let arifa = Arc::new(
Arifa::new(redis_url, &node_id)
.await
.expect("Failed to init Arifa"),
);
Self { node_id, arifa }
}
}