Kayrx
kayrx : 异步非阻塞-事件驱动, I/O-Net-HTTP-Web-Client全栈开源平台.
Info
Kayrx 诞生于 Actix-* 和 Tokio 可作为定制版(兼容Actix-web 2.0 - 查看 Examples)
特征
- Fiber异步运行时
- 多线程服务器
- IO, FS, Net (Tcp, Udp, Uds)
- 同步原语和通道
- 计时器:超时,延迟和定时
- 编解码器:解码,编码,帧
- 支持HTTP / 1.x和HTTP / 2.0协议
- Streaming and pipelining
- Keep-alive and slow requests handling
- 服务器/客户端WebSockets支持
- 透明的内容压缩/解压缩(br,gzip,deflate)
- 可配置的请求路由器
- Multipart streams
- Static assets
- Rustls的SSL支持
- 中间件(Logger, CORS, 等)
- 异步HTTP客户端
生态组件库
Example
Dependencies:
[dependencies]
kayrx = "0.7"
Code:
#[macro_use]
extern crate kayrx;
use kayrx::web::{web, App, HttpServer, Responder};
#[get("/{id}/{name}/index.html")]
async fn index(info: web::Path<(u32, String)>) -> impl Responder {
format!("Hello {}! id:{}", info.1, info.0)
}
#[kayrx::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| App::new().service(index))
.bind("127.0.0.1:8080")?
.run()
.await
}
查看更多 Examples
License
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
