mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 22:38:01 -06:00
Start to make dynamic interfaces work
This commit is contained in:
Generated
-19
@@ -177,21 +177,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-channel"
|
||||
version = "0.5.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2"
|
||||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.7"
|
||||
@@ -650,11 +635,7 @@ dependencies = [
|
||||
name = "unshell-lib"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"chrono",
|
||||
"crossbeam-channel",
|
||||
"libc",
|
||||
"rand",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"unshell-obfuscate",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
mod manager;
|
||||
mod module;
|
||||
mod module_interface;
|
||||
pub mod network;
|
||||
// pub mod network;
|
||||
mod proc_load;
|
||||
|
||||
pub mod interface;
|
||||
@@ -11,7 +11,7 @@ use std::sync::{Arc, Mutex};
|
||||
pub use manager::Manager;
|
||||
pub use module::Module;
|
||||
|
||||
pub use interface::{InterfaceWrapper, NamedComponent};
|
||||
pub use interface::{InterfaceWrapper, NamedComponent, PayloadConfig};
|
||||
|
||||
extern crate unshell_lib;
|
||||
use unshell_lib::Result;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use unshell_lib::{Announcement, Result};
|
||||
|
||||
use crate::network::Stream;
|
||||
// use crate::network::Stream;
|
||||
|
||||
use crate::Manager;
|
||||
|
||||
@@ -27,10 +27,10 @@ impl Manager {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn broadcast(&mut self, announcement: Announcement) -> Result<()> {
|
||||
for connection in &mut self.connections {
|
||||
connection.write(announcement.clone())?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
// pub fn broadcast(&mut self, announcement: Announcement) -> Result<()> {
|
||||
// for connection in &mut self.connections {
|
||||
// connection.write(announcement.clone())?;
|
||||
// }
|
||||
// Ok(())
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
mod announcement;
|
||||
mod connection;
|
||||
// mod connection;
|
||||
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
@@ -15,7 +15,7 @@ use crate::{
|
||||
ModuleRuntime,
|
||||
interface::{NamedComponent, PayloadConfig},
|
||||
module::Module,
|
||||
network::Stream,
|
||||
// network::Stream,
|
||||
};
|
||||
|
||||
// #[derive(Debug)]
|
||||
@@ -28,8 +28,7 @@ pub struct Manager {
|
||||
|
||||
components: HashMap<String, NamedComponent>,
|
||||
active_runtimes: Vec<Box<dyn ModuleRuntime>>,
|
||||
|
||||
pub connections: Vec<Box<dyn Stream<Announcement>>>,
|
||||
// pub connections: Vec<Box<dyn Stream<Announcement>>>,
|
||||
}
|
||||
|
||||
// static mut MANAGER_RUNTIME: Option<Arc<Mutex<Manager>>> = None;
|
||||
@@ -46,8 +45,7 @@ impl Manager {
|
||||
.map(|c| (c.name.to_string(), c))
|
||||
.collect(),
|
||||
active_runtimes: Vec::new(),
|
||||
|
||||
connections: Vec::new(),
|
||||
// connections: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,11 +128,11 @@ impl Manager {
|
||||
}
|
||||
});
|
||||
|
||||
// Read announcements
|
||||
this_lock.recv_connection_announcements();
|
||||
// // Read announcements
|
||||
// this_lock.recv_connection_announcements();
|
||||
|
||||
// Prune dead connections
|
||||
this_lock.prune_connections();
|
||||
// // Prune dead connections
|
||||
// this_lock.prune_connections();
|
||||
|
||||
drop(this_lock)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user