diff options
author | Vincent Ambo <tazjin@gmail.com> | 2018-04-08T14·41+0200 |
---|---|---|
committer | Vincent Ambo <tazjin@gmail.com> | 2018-04-08T14·41+0200 |
commit | bea6eb8eb3cf97586155fa4857c6edd6a64fc84e (patch) | |
tree | 8c2eb853fcaf4b8e3359ce128cc36fc2c6563051 /src/db.rs | |
parent | 5604d933e89f9020299f59d927d73f2cd12b4134 (diff) |
feat(db): Bootstrap DbExecutor actor
Bootstraps an Actix actor carrying DB connections. This actor will be used to interact with converse's database.
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/db.rs b/src/db.rs new file mode 100644 index 000000000000..57aa5f9827f6 --- /dev/null +++ b/src/db.rs @@ -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>; +} |