8 个重大版本

0.9.0 2021年7月6日
0.8.0 2021年1月5日
0.7.0 2020年1月4日
0.5.0 2019年12月17日
0.1.0 2018年9月26日

#219 in Unix API

Download history 20171/week @ 2024-03-14 23424/week @ 2024-03-21 18819/week @ 2024-03-28 22203/week @ 2024-04-04 24143/week @ 2024-04-11 24357/week @ 2024-04-18 21424/week @ 2024-04-25 19353/week @ 2024-05-02 20002/week @ 2024-05-09 19425/week @ 2024-05-16 16798/week @ 2024-05-23 16985/week @ 2024-05-30 17240/week @ 2024-06-06 18199/week @ 2024-06-13 16127/week @ 2024-06-20 12963/week @ 2024-06-27

67,993 每月下载量
用于 34 个crate(8 个直接使用)

MIT/Apache

28KB
633 行代码(不含注释)

parity-tokio-ipc

CI Documentation

该crate抽象了UNIX/Windows的进程间传输。

它利用UNIX套接字在UNIX(通过 tokio::net::UnixStream)和命名管道在Windows(通过 tokio::net::windows::named_pipe 模块)上。

端点是传入连接的无传输接口

use parity_tokio_ipc::Endpoint;
use futures::stream::StreamExt;

// For testing purposes only - instead, use a path to an actual socket or a pipe
let addr = parity_tokio_ipc::dummy_endpoint();

let server = async move {
    Endpoint::new(addr)
        .incoming()
        .expect("Couldn't set up server")
        .for_each(|conn| async {
            match conn {
                Ok(stream) => println!("Got connection!"),
                Err(e) => eprintln!("Error when receiving connection: {:?}", e),
            }
        });
};

let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
rt.block_on(server);

许可证

parity-tokio-ipc 主要在MIT许可证和Apache许可证(版本2.0)的条款下分发,部分受各种类似BSD的许可证的保护。

请参阅LICENSE-APACHE和LICENSE-MIT以获取详细信息。

依赖关系

~3–12MB
~124K SLoC