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
67,993 每月下载量
用于 34 个crate(8 个直接使用)
28KB
633 行代码(不含注释)
parity-tokio-ipc
该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