mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 02:05:30 +00:00
http_private: add config, launch with cli helpers
This commit is contained in:
parent
6e97bff93f
commit
088daa72ff
8 changed files with 200 additions and 30 deletions
|
|
@ -1,24 +1,14 @@
|
|||
mod workers;
|
||||
use dotenv::dotenv;
|
||||
use aquatic_cli_helpers::run_app_with_cli_and_config;
|
||||
use aquatic_http_private::config::Config;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
dotenv().ok();
|
||||
#[global_allocator]
|
||||
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
||||
let mut handles = Vec::new();
|
||||
|
||||
for _ in 0..2 {
|
||||
let handle = ::std::thread::Builder::new()
|
||||
.name("socket".into())
|
||||
.spawn(move || workers::socket::run_socket_worker())?;
|
||||
|
||||
handles.push(handle);
|
||||
}
|
||||
|
||||
for handle in handles {
|
||||
handle
|
||||
.join()
|
||||
.map_err(|err| anyhow::anyhow!("thread join error: {:?}", err))??;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
fn main() {
|
||||
run_app_with_cli_and_config::<Config>(
|
||||
aquatic_http_private::APP_NAME,
|
||||
aquatic_http_private::APP_VERSION,
|
||||
aquatic_http_private::run,
|
||||
None,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue