|
@@ -6,13 +6,13 @@ use tokio::time::{timeout, Duration};
|
|
const LOCK_TIMEOUT: u64 = 30;
|
|
const LOCK_TIMEOUT: u64 = 30;
|
|
|
|
|
|
#[derive(Clone)]
|
|
#[derive(Clone)]
|
|
-pub struct SharedData<T> {
|
|
|
|
|
|
+pub struct Shard<T> {
|
|
pub data: Arc<Mutex<T>>,
|
|
pub data: Arc<Mutex<T>>,
|
|
}
|
|
}
|
|
|
|
|
|
-impl<T> SharedData<T> {
|
|
|
|
|
|
+impl<T> Shard<T> {
|
|
pub fn new(data: T) -> Self {
|
|
pub fn new(data: T) -> Self {
|
|
- SharedData {
|
|
|
|
|
|
+ Shard {
|
|
data: Arc::new(Mutex::new(data)),
|
|
data: Arc::new(Mutex::new(data)),
|
|
}
|
|
}
|
|
}
|
|
}
|