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:
parent
5604d933e8
commit
bea6eb8eb3
3 changed files with 45 additions and 1 deletions
13
src/db.rs
Normal file
13
src/db.rs
Normal 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>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue