Crates.io | tipsy |
lib.rs | tipsy |
version | 0.6.3 |
created_at | 2024-05-22 04:26:22.108877+00 |
updated_at | 2025-09-06 18:30:52.837034+00 |
description | Cross-platform IPC for Tokio |
homepage | https://github.com/aschey/tipsy |
repository | https://github.com/aschey/tipsy |
max_upload_size | |
id | 1247467 |
size | 67,546 |
This is a fork of parity-tokio-ipc.
tipsy is a library for cross-platform async
IPC using Tokio. It utilizes unix sockets on UNIX (via
tokio::net::UnixStream
)
and named pipes on windows (via
tokio::net::windows::named_pipe
).
use futures_util::stream::StreamExt;
use std::error::Error;
use tipsy::{Endpoint, OnConflict, ServerId};
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
Endpoint::new(ServerId::new("my-server"), OnConflict::Overwrite)?
.incoming()?
.for_each(|conn| async {
match conn {
Ok(stream) => println!("Got connection!"),
Err(e) => eprintln!("Error when receiving connection: {:?}", e),
}
});
Ok(())
}
use std::error::Error;
use tipsy::{Endpoint, ServerId};
use tokio::io::AsyncWriteExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let mut client = Endpoint::connect(ServerId::new("my-server")).await?;
client.write_all(b"ping").await?;
Ok(())
}
See examples.
The MSRV is currently 1.85.0
. Since Cargo's V3 resolver supports MSRV-aware
dependencies, we do not treat an MSRV bump as a breaking change.