use actix::{Actor, SyncContext};
use diesel::{MysqlConnection, r2d2::ConnectionManager};
use r2d2::Pool;
pub struct MysqlActor {
conn: Pool<ConnectionManager<MysqlConnection>>
}
impl MysqlActor {
pub fn new(conn: Pool<ConnectionManager<MysqlConnection>>) -> Self {
MysqlActor { conn }
}
}
impl Actor for MysqlActor {
type Context = SyncContext<Self>;
fn started(&mut self, _ctx: &mut Self::Context) {
info!("Mysql Actor started")
}
}