about summary refs log tree commit diff
path: root/src/db.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-08T14·41+0200
committerVincent Ambo <tazjin@gmail.com>2018-04-08T14·41+0200
commitbea6eb8eb3cf97586155fa4857c6edd6a64fc84e (patch)
tree8c2eb853fcaf4b8e3359ce128cc36fc2c6563051 /src/db.rs
parent5604d933e89f9020299f59d927d73f2cd12b4134 (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.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/db.rs b/src/db.rs
new file mode 100644
index 0000000000..57aa5f9827
--- /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>;
+}