A simple asynchronous server/client crate built on tokio for easy two-way streaming.
Enable asynchronous full duplex streaming of semi-complex data-structures between a rust server and clients. gRPC implementations are suboptimal for this:
Message
can be transmitted:
rust
trait Message: Send + 'static + Clone + Encode + Decode
In your Cargo.toml:
toml
[dependencies]
kumoko = { version = "0.3", features = ["full"] }
tokio = { version = "1.20", features = ["macros", "rt-multi-thread"] }
Minimal Client: ```rust use kumoko::client::Client;
async fn main() -> Result<(), Box
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;
async fn main() -> Result<(), Box
let msg = format!("Hello {}! Happy to see you here!", req);
server.send_response(msg, target.into()).await?;
}
} ```