Crate conduit_hyper
source · [−]Expand description
A wrapper for integrating hyper 0.13
with a conduit 0.8
blocking application stack.
A conduit::Handler
is allowed to block so the Server
must be spawned on the (default)
multi-threaded Runtime
which allows (by default) 100 concurrent blocking threads. Any excess
requests will asynchronously await for an available blocking thread.
Examples
Try out the example with cargo run --example server
.
Typical usage:
use conduit::Handler;
use conduit_hyper::Server;
use tokio::runtime::Runtime;
#[tokio::main]
async fn main() {
let app = build_conduit_handler();
let addr = ([127, 0, 0, 1], 12345).into();
let server = Server::serve(&addr, app);
server.await;
}
fn build_conduit_handler() -> impl Handler {
// ...
}
Structs
A builder for a
hyper::Server
(behind an opaque impl Future
).A builder for a
hyper::Service
.