another failure

another-service-failure
Avril 4 years ago
parent 5878be6216
commit 5fe9c4795c
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -26,7 +26,7 @@ pretty_env_logger = "0.4.0"
serde = {version = "1.0.118", features=["derive"]}
sha2 = "0.9.2"
smallvec = {version = "1.6.0", features= ["union", "serde", "write"]}
smolset = "1.1.0"
smolset = "1.1"
tokio = {version = "0.2", features=["full"] }
uuid = {version = "0.8.1", features=["v4","serde"]}
warp = "0.2.5"

@ -21,9 +21,9 @@ cfg_if!{
if #[cfg(debug_assertions)] {
/// Type used for directed array.
/// Currently testing `smolset` over eagerly allocating.
type SESet<T> = smolset::SmolSet<[T; 1]>;
pub(super) type SESet<T> = smolset::SmolSet<[T; 1]>;
} else {
type SESet<T> = std::collections::HashSet<T>;
pub(super) type SESet<T> = std::collections::HashSet<T>;
}
}

@ -11,6 +11,8 @@ const SUPERVISOR_BACKLOG: usize = 32;
mod dispatch; pub use dispatch::*;
//TODO: This all needs redoing when i'm actually lucid. This part seems okay but the rest of `service` needs to go and be replaced by something like this
/// Signal the shutdown method to the supervisor.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy)]
pub enum SupervisorControl
@ -64,13 +66,25 @@ pub(super) struct Supervisor
#[derive(Debug)]
struct SupervisorShared
{
//// scratch that, idk what this was supposed to be for. I'm sure i'll remember if it's important.
//sub: RwLock<BTreeMap<ServiceEventKind, ServiceEvent>>,
/// this is for filtering specific messages to specific subscribers
sub: RwLock<BTreeMap<ServiceEventKind, SESet<ServiceSubID>>>,
broadcast_root: broadcast::Sender<ServiceEvent>,
state: state::State,
}
/// A subscriber to supervisor task(s) event pump
#[derive(Debug)]
pub struct Subscriber
{
id: ServiceSubID,
/// For directed messages
spec: mpsc::Receiver<ServiceEvent>,
/// For broadcast messages
broad: broadcast::Receiver<ServiceEvent>,
}
impl Supervisor
{

Loading…
Cancel
Save