mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
http: quit if any worker thread quits
This commit is contained in:
parent
4ca73630c4
commit
d7e06468c3
8 changed files with 151 additions and 145 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use std::fmt::Display;
|
||||
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
|
@ -198,3 +199,25 @@ pub fn spawn_prometheus_endpoint(
|
|||
|
||||
Ok(handle)
|
||||
}
|
||||
|
||||
pub enum WorkerType {
|
||||
Swarm(usize),
|
||||
Socket(usize),
|
||||
Statistics,
|
||||
Signals,
|
||||
#[cfg(feature = "prometheus")]
|
||||
Prometheus,
|
||||
}
|
||||
|
||||
impl Display for WorkerType {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Swarm(index) => f.write_fmt(format_args!("Swarm worker {}", index + 1)),
|
||||
Self::Socket(index) => f.write_fmt(format_args!("Socket worker {}", index + 1)),
|
||||
Self::Statistics => f.write_str("Statistics worker"),
|
||||
Self::Signals => f.write_str("Signals worker"),
|
||||
#[cfg(feature = "prometheus")]
|
||||
Self::Prometheus => f.write_str("Prometheus worker"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue