feat(db): Bootstrap DbExecutor actor

Bootstraps an Actix actor carrying DB connections. This actor will be
used to interact with converse's database.
This commit is contained in:
Vincent Ambo 2018-04-08 16:41:34 +02:00
parent 5604d933e8
commit bea6eb8eb3
3 changed files with 45 additions and 1 deletions

13
src/db.rs Normal file
View file

@ -0,0 +1,13 @@
//! This module implements the database connection actor.
use actix::prelude::*;
use diesel::prelude::PgConnection;
use diesel::r2d2::{Pool, ConnectionManager};
/// The DB actor itself. Several of these will be run in parallel by
/// `SyncArbiter`.
pub struct DbExecutor(pub Pool<ConnectionManager<PgConnection>>);
impl Actor for DbExecutor {
type Context = SyncContext<Self>;
}