Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 43 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ futures = { version = "0.3", default-features = false }
toml = { version = "0.8", default-features = false }
tokio = { version = "1", default-features = false }
tokio-stream = { version = "0.1", default-features = false }
tracing = { version = "0.1", default-features = false }
tracing-futures = { version = "0.2", default-features = false }
tracing = { version = "0.1", default-features = false, features = ["attributes"] }
tracing-subscriber = { version = "0.3", default-features = false }
serde = { version = "1", default-features = false, features = ["rc"] }
serde_json = { version = "1", default-features = false }
Expand Down
3 changes: 0 additions & 3 deletions drivers/drmem-drv-ntp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ tokio.features = ["net", "time", "macros"]
tracing.workspace = true
tracing.default-features = false

tracing-futures.workspace = true
tracing-futures.default-features = false

tracing-subscriber.workspace = true
tracing-subscriber.default-features = false

Expand Down
14 changes: 6 additions & 8 deletions drivers/drmem-drv-ntp/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
use drmem_api::{
device,
driver::{self, DriverConfig},
driver::{self, DriverConfig, ResettableState},
Error, Result,
};
use std::convert::Infallible;
use std::future::Future;
use std::sync::Arc;
use std::{
net::{SocketAddr, SocketAddrV4},
str,
};
use tokio::net::UdpSocket;
use tokio::sync::Mutex;
use tokio::time::{self, Duration};
use tracing::{debug, error, trace, warn, Span};

Expand Down Expand Up @@ -428,9 +426,9 @@ impl driver::API for Instance {
}
}

async fn run(
&mut self,
devices: Arc<Mutex<Self::HardwareType>>,
async fn run<'a>(
&'a mut self,
devices: &'a mut Self::HardwareType,
) -> Infallible {
// Record the peer's address in the "cfg" field of the span.

Expand All @@ -451,8 +449,6 @@ impl driver::API for Instance {
let mut info = Some(server::Info::bad_value());
let mut interval = time::interval(Duration::from_millis(20_000));

let mut devices = devices.lock().await;

loop {
interval.tick().await;

Expand Down Expand Up @@ -536,3 +532,5 @@ mod tests {
.is_none());
}
}

impl ResettableState for Devices {}
3 changes: 0 additions & 3 deletions drivers/drmem-drv-sump/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ tokio.features = ["net", "io-util", "time"]
tracing.workspace = true
tracing.default-features = false

tracing-futures.workspace = true
tracing-futures.default-features = false

tracing-subscriber.workspace = true
tracing-subscriber.default-features = false

Expand Down
Loading