mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
ws: use file naming more in line with other impls; other small fixes
This commit is contained in:
parent
1e77745a84
commit
baec259feb
10 changed files with 10 additions and 16 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
pub mod common;
|
pub mod common;
|
||||||
pub mod handlers;
|
pub mod request;
|
||||||
pub mod network;
|
pub mod socket;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
fs::File,
|
fs::File,
|
||||||
|
|
@ -19,7 +19,7 @@ use glommio::{channels::channel_mesh::MeshBuilder, prelude::*};
|
||||||
|
|
||||||
const SHARED_CHANNEL_SIZE: usize = 1024;
|
const SHARED_CHANNEL_SIZE: usize = 1024;
|
||||||
|
|
||||||
pub fn run_inner(config: Config, state: State) -> anyhow::Result<()> {
|
pub fn run(config: Config, state: State) -> anyhow::Result<()> {
|
||||||
let num_peers = config.socket_workers + config.request_workers;
|
let num_peers = config.socket_workers + config.request_workers;
|
||||||
|
|
||||||
let request_mesh_builder = MeshBuilder::partial(num_peers, SHARED_CHANNEL_SIZE);
|
let request_mesh_builder = MeshBuilder::partial(num_peers, SHARED_CHANNEL_SIZE);
|
||||||
|
|
@ -49,7 +49,7 @@ pub fn run_inner(config: Config, state: State) -> anyhow::Result<()> {
|
||||||
WorkerIndex::SocketWorker(i),
|
WorkerIndex::SocketWorker(i),
|
||||||
);
|
);
|
||||||
|
|
||||||
network::run_socket_worker(
|
socket::run_socket_worker(
|
||||||
config,
|
config,
|
||||||
state,
|
state,
|
||||||
tls_config,
|
tls_config,
|
||||||
|
|
@ -79,7 +79,7 @@ pub fn run_inner(config: Config, state: State) -> anyhow::Result<()> {
|
||||||
WorkerIndex::RequestWorker(i),
|
WorkerIndex::RequestWorker(i),
|
||||||
);
|
);
|
||||||
|
|
||||||
handlers::run_request_worker(config, state, request_mesh_builder, response_mesh_builder)
|
request::run_request_worker(config, state, request_mesh_builder, response_mesh_builder)
|
||||||
.await
|
.await
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
|
||||||
|
|
||||||
cfg_if!(
|
cfg_if!(
|
||||||
if #[cfg(feature = "with-glommio")] {
|
if #[cfg(feature = "with-glommio")] {
|
||||||
::std::thread::spawn(move || glommio::run_inner(config, state));
|
::std::thread::spawn(move || glommio::run(config, state));
|
||||||
} else {
|
} else {
|
||||||
::std::thread::spawn(move || mio::run(config, state));
|
::std::thread::spawn(move || mio::run(config, state));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ use parking_lot::Mutex;
|
||||||
use privdrop::PrivDrop;
|
use privdrop::PrivDrop;
|
||||||
|
|
||||||
pub mod common;
|
pub mod common;
|
||||||
pub mod handlers;
|
pub mod request;
|
||||||
pub mod network;
|
pub mod socket;
|
||||||
|
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use common::*;
|
use common::*;
|
||||||
|
|
@ -85,7 +85,7 @@ pub fn start_workers(config: Config, state: State) -> anyhow::Result<()> {
|
||||||
WorkerIndex::SocketWorker(i),
|
WorkerIndex::SocketWorker(i),
|
||||||
);
|
);
|
||||||
|
|
||||||
network::run_socket_worker(
|
socket::run_socket_worker(
|
||||||
config,
|
config,
|
||||||
state,
|
state,
|
||||||
i,
|
i,
|
||||||
|
|
@ -144,7 +144,7 @@ pub fn start_workers(config: Config, state: State) -> anyhow::Result<()> {
|
||||||
WorkerIndex::RequestWorker(i),
|
WorkerIndex::RequestWorker(i),
|
||||||
);
|
);
|
||||||
|
|
||||||
handlers::run_request_worker(
|
request::run_request_worker(
|
||||||
config,
|
config,
|
||||||
state,
|
state,
|
||||||
in_message_receiver,
|
in_message_receiver,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
use aquatic_common::access_list::{AccessListMode, AccessListQuery};
|
|
||||||
use histogram::Histogram;
|
|
||||||
|
|
||||||
use crate::common::*;
|
|
||||||
use crate::config::Config;
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue