ciallo-native

    Native HTTP server adapter for unmbt/ciallo built on stdlib moonbitlang/core/async/http and signal graceful drain

    web
    http
    server
    native
    ciallo
    Download zip
    Author
    Version
    0.1.1
    License
    MIT
    Last updated
    13 hours ago
    Downloads
    8

    #unmbt/ciallo-native

    Pure native HTTP server adapter for unmbt/ciallo with bounded non-shielded graceful drain, Keep-Alive instant idle wake-up, early-abort unread body close, exact UTF-8 Content-Length, and 1:1 structured Cookie bridging.

    NativeWsHandler

    type NativeWsHandler = async (NativeWsConn) -> Unit

    NativeServerOptions

    pub(all) struct NativeServerOptions {
    host : String
    port : Int
    max_connections : Int
    reuse_addr : Bool
    install_signal_handlers : Bool
    request_timeout_ms : Int?
    shutdown_timeout_ms : Int
    public_origin : String?
    trust_proxy : Bool
    } derive(Eq,
    Debug
    )

    NativeServerOptions::NativeServerOptions

    fn NativeServerOptions::NativeServerOptions(host? : String, port? : Int, max_connections? : Int, reuse_addr? : Bool, install_signal_handlers? : Bool, request_timeout_ms? : Int, shutdown_timeout_ms? : Int, public_origin? : String, trust_proxy? : Bool) -> NativeServerOptions

    NativeWsConn

    pub struct NativeWsConn {
    conn :
    Conn

    }

    Native WebSocket connection wrapping moonbitlang/core/async/websocket::Conn.

    NativeWsConn::close

    fn NativeWsConn::close(self : NativeWsConn) -> Unit

    serve

    async fn serve(app :
    App
    , options? : NativeServerOptions, env? :
    Env
    , on_listen? : (Int) -> Unit) -> Unit

    serve_with_ws

    async fn serve_with_ws(app :
    App
    , ws_routes~ : Map[String, async (NativeWsConn) -> Unit], options? : NativeServerOptions, env? :
    Env
    , on_listen? : (Int) -> Unit) -> Unit

    Serves an HTTP @core.App alongside first-class WebSocket upgrade routes powered by moonbitlang/core/async/websocket.