Kumoko

A simple asynchronous server/client crate built on tokio for easy two-way streaming.

Website | API Docs

Unstable Warning!

Motivation

Enable asynchronous full duplex streaming of semi-complex data-structures between a rust server and clients. gRPC implementations are suboptimal for this:

Features

Examples

In your Cargo.toml: toml [dependencies] tokio = { version = "1.20.0", features = ["macros", "rt-multi-thread"] } kumoko = "0.3"

Minimal Client: ```rust use kumoko::client::Client;

[tokio::main]

async fn main() -> Result<(), Box> { let mut client = Client::connect("[::1]:50052").await?;

client.send_request("Ferris".to_string()).await;
let msg: String = client.get_response().await.unwrap();
println!("{}", msg);

Ok(())

} ```

Minimal Server: ```rust use kumoko::server::Server;

[tokio::main]

async fn main() -> Result<(), Box> { let mut server = Server::::bind("[::1]:50052").await?; loop{ let (req, target) = server.get_request().await;

    let msg = format!("Hello {}! Happy to see you here!", req);
    server.send_response(msg, target.into()).await?;
}

} ```