database: Switch to tokio channels

This commit is contained in:
Elias Projahn 2021-04-25 22:33:40 +02:00
parent 641a6306ec
commit d9746c8ab4
3 changed files with 3 additions and 4 deletions

View file

@ -6,9 +6,9 @@ edition = "2018"
[dependencies] [dependencies]
diesel = { version = "1.4.5", features = ["sqlite"] } diesel = { version = "1.4.5", features = ["sqlite"] }
diesel_migrations = "1.4.0" diesel_migrations = "1.4.0"
futures-channel = "0.3.5"
rand = "0.7.3" rand = "0.7.3"
serde = { version = "1.0.117", features = ["derive"] } serde = { version = "1.0.117", features = ["derive"] }
serde_json = "1.0.59" serde_json = "1.0.59"
thiserror = "1.0.23" thiserror = "1.0.23"
tokio = { version = "1.4.0", features = ["sync"] }
uuid = { version = "0.8", features = ["v4"] } uuid = { version = "0.8", features = ["v4"] }

View file

@ -14,7 +14,7 @@ pub enum Error {
SendError(#[from] std::sync::mpsc::SendError<super::thread::Action>), SendError(#[from] std::sync::mpsc::SendError<super::thread::Action>),
#[error(transparent)] #[error(transparent)]
ReceiveError(#[from] futures_channel::oneshot::Canceled), ReceiveError(#[from] tokio::sync::oneshot::error::RecvError),
#[error("Database error: {0}")] #[error("Database error: {0}")]
Other(String), Other(String),

View file

@ -1,6 +1,5 @@
use super::*; use super::*;
use futures_channel::oneshot; use tokio::sync::oneshot::{self, Sender};
use futures_channel::oneshot::Sender;
use std::sync::mpsc; use std::sync::mpsc;
use std::thread; use std::thread;