1 Star 0 Fork 0

Gitee 极速下载 / kbio

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/KuiBaDB/kbio
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

kbio, the Async IO Framework based on io_uring, is used in KuiBaDB to implement async io.

Features

  • Support multi-threading concurrent task submission.
  • Very Fast.
  • Implement AsyncRead/AsyncWrite trait introduced in tokio.

Examples

async fn read_body(stream: &mut Sock, content: &mut Vec<u8>) -> io::Result<()> {
    let len = stream.read_u32().await?;
    let msglen = len as usize - size_of::<u32>();
    content.reserve(msglen);
    unsafe {
        content.set_len(msglen);
    }
    stream.read_exact(content.as_mut_slice()).await?;
    return Ok(());
}

See examples in examples/ and the source code of KuiBaDB for more details.

Repository Comments ( 0 )

Sign in to post a comment

About

kbio 是基于 io_uring 的异步 IO 框架,被用于实现 KuiBaDB 的异步 I/O expand collapse
Rust
Apache-2.0
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
Rust
1
https://toscode.gitee.com/mirrors/kbio.git
git@toscode.gitee.com:mirrors/kbio.git
mirrors
kbio
kbio
master

Search

182229 41614e54 1850385 182230 7885ed45 1850385