rust-web-server 18.3.0

Single-binary web server and reverse proxy: automatic HTTPS (Let's Encrypt), HTTP/1.1, HTTP/2 and HTTP/3, load balancing, auth and rate limiting, configured in one TOML file. Also a Rust library: routing, middleware, MCP server, ORM, background jobs. No hyper, no Tower; HTTP/2 and HTTP/3 framing via h2 and quinn.
Documentation
use crate::thread_pool::ThreadPool;

#[test]
fn thread_pool_test() {
    fn fn_to_execute_by_threadpool() {
        println!("{}", 2 + 2);
    }

    let thread_count : usize = 4;
    let pool = ThreadPool::new(thread_count);
    pool.execute(move ||  {
        fn_to_execute_by_threadpool();
    });
}
#[test]
fn worker_survives_a_panicking_job() {
    use std::sync::mpsc;
    use std::time::Duration;
    // One worker: if the panic killed it, the second job would never run.
    let pool = ThreadPool::new(1);
    pool.execute(|| panic!("handler bug"));
    let (tx, rx) = mpsc::channel();
    pool.execute(move || tx.send(42).unwrap());
    assert_eq!(Ok(42), rx.recv_timeout(Duration::from_secs(5)));
}