[][src]Crate conduit_hyper

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 futures::executor::block_on;
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::bind(&addr, app);

    server.await;
}

fn build_conduit_handler() -> impl Handler {
    // ...
}

Re-exports

pub use semver;

Structs

Server

A builder for a hyper::Server (behind an opaque impl Future).

Service

A builder for a hyper::Service.