mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
WIP: use shared swarm state in mio worker
This commit is contained in:
parent
53497308f1
commit
2da966098f
5 changed files with 79 additions and 255 deletions
|
|
@ -13,6 +13,7 @@ use crossbeam_utils::CachePadded;
|
|||
use hdrhistogram::Histogram;
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::swarm::TorrentMaps;
|
||||
|
||||
pub const BUFFER_SIZE: usize = 8192;
|
||||
|
||||
|
|
@ -230,13 +231,15 @@ pub enum StatisticsMessage {
|
|||
#[derive(Clone)]
|
||||
pub struct State {
|
||||
pub access_list: Arc<AccessListArcSwap>,
|
||||
pub torrent_maps: TorrentMaps,
|
||||
pub server_start_instant: ServerStartInstant,
|
||||
}
|
||||
|
||||
impl Default for State {
|
||||
fn default() -> Self {
|
||||
impl State {
|
||||
pub fn new(config: &Config) -> Self {
|
||||
Self {
|
||||
access_list: Arc::new(AccessListArcSwap::default()),
|
||||
torrent_maps: TorrentMaps::new(config),
|
||||
server_start_instant: ServerStartInstant::new(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue