|
@@ -13,8 +13,8 @@ use aspect_core::message_queue::{MessageQueueId, Origin, QueueEntry};
|
|
use aspect_sqldb::{device_queue_sub, message_queue};
|
|
use aspect_sqldb::{device_queue_sub, message_queue};
|
|
use aspect_util::codec;
|
|
use aspect_util::codec;
|
|
|
|
|
|
-use crate::msg_queue::{self, Msg, QueueId, ReaderId};
|
|
|
|
-use crate::{errors::*, mq};
|
|
|
|
|
|
+use crate::generic_msg_queue::{self, Msg, QueueId, ReaderId};
|
|
|
|
+use crate::{errors::*, llmq};
|
|
|
|
|
|
#[derive(Clone, Debug)]
|
|
#[derive(Clone, Debug)]
|
|
pub struct QueueStatus {
|
|
pub struct QueueStatus {
|
|
@@ -30,7 +30,7 @@ pub struct QueueStatus {
|
|
|
|
|
|
pub struct DeviceMqDatastore {
|
|
pub struct DeviceMqDatastore {
|
|
/// Underlying wrapper around the higher level interface to the MQ data.
|
|
/// Underlying wrapper around the higher level interface to the MQ data.
|
|
- msg_queue: Arc<msg_queue::MsgQueueDatastore>,
|
|
|
|
|
|
+ msg_queue: Arc<generic_msg_queue::GenericMqDatastore>,
|
|
|
|
|
|
/// Database connection for the high level device data.
|
|
/// Database connection for the high level device data.
|
|
dbc: DatabaseConnection,
|
|
dbc: DatabaseConnection,
|
|
@@ -38,7 +38,7 @@ pub struct DeviceMqDatastore {
|
|
|
|
|
|
impl DeviceMqDatastore {
|
|
impl DeviceMqDatastore {
|
|
pub fn new(
|
|
pub fn new(
|
|
- msg_queue: Arc<msg_queue::MsgQueueDatastore>,
|
|
|
|
|
|
+ msg_queue: Arc<generic_msg_queue::GenericMqDatastore>,
|
|
dbc: DatabaseConnection,
|
|
dbc: DatabaseConnection,
|
|
) -> Result<Self, Error> {
|
|
) -> Result<Self, Error> {
|
|
Ok(Self { msg_queue, dbc })
|
|
Ok(Self { msg_queue, dbc })
|
|
@@ -150,8 +150,8 @@ impl DeviceMqDatastore {
|
|
idx,
|
|
idx,
|
|
timestamp: mdata.timestamp(),
|
|
timestamp: mdata.timestamp(),
|
|
origin: match mdata.origin() {
|
|
origin: match mdata.origin() {
|
|
- mq::state::Origin::Device(id) => Origin::Device(*id),
|
|
|
|
- mq::state::Origin::None(_) => Origin::None(()),
|
|
|
|
|
|
+ llmq::state::Origin::Device(id) => Origin::Device(*id),
|
|
|
|
+ llmq::state::Origin::None(_) => Origin::None(()),
|
|
},
|
|
},
|
|
data: mdata.into_data(),
|
|
data: mdata.into_data(),
|
|
};
|
|
};
|
|
@@ -359,16 +359,16 @@ fn now_ts() -> u64 {
|
|
time::UNIX_EPOCH.elapsed().expect("db: now_ts").as_millis() as u64
|
|
time::UNIX_EPOCH.elapsed().expect("db: now_ts").as_millis() as u64
|
|
}
|
|
}
|
|
|
|
|
|
-fn conv_down_origin(o: &Origin) -> mq::state::Origin {
|
|
|
|
|
|
+fn conv_down_origin(o: &Origin) -> llmq::state::Origin {
|
|
match o {
|
|
match o {
|
|
- Origin::Device(id) => mq::state::Origin::Device(*id),
|
|
|
|
- Origin::None(_) => mq::state::Origin::none(),
|
|
|
|
|
|
+ Origin::Device(id) => llmq::state::Origin::Device(*id),
|
|
|
|
+ Origin::None(_) => llmq::state::Origin::none(),
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-fn conv_up_origin(o: &mq::state::Origin) -> Origin {
|
|
|
|
|
|
+fn conv_up_origin(o: &llmq::state::Origin) -> Origin {
|
|
match o {
|
|
match o {
|
|
- mq::state::Origin::Device(id) => Origin::Device(*id),
|
|
|
|
- mq::state::Origin::None(_) => Origin::none(),
|
|
|
|
|
|
+ llmq::state::Origin::Device(id) => Origin::Device(*id),
|
|
|
|
+ llmq::state::Origin::None(_) => Origin::none(),
|
|
}
|
|
}
|
|
}
|
|
}
|