#unix-socket #ipc #subprocess

tokio-unix-ipc

A minimal abstraction for IPC via unix sockets

3 releases (breaking)

0.3.0 Sep 17, 2022
0.2.0 Aug 6, 2021
0.1.0 Aug 1, 2021

#1484 in Encoding

45 downloads per month

Apache-2.0

45KB
948 lines

tokio-unix-ipc

Build Status Crates.io License rustc 1.53.0 Documentation

This crate implements a minimal abstraction over UNIX domain sockets for the purpose of IPC on top of tokio. It lets you send both file handles and rust objects between processes. This is a replacement for my earlier unix-ipc crate.

How it works

This uses serde to serialize data over unix sockets via bincode. Thanks to the Handle abstraction you can also send any object across that is convertable into a unix file handle.

The way this works under the hood is that during serialization and deserialization encountered file descriptors are tracked. They are then sent over the unix socket separately. This lets unassociated processes share file handles.

If you only want the unix socket abstraction you can disable all default features and use the raw channels.

Feature Flags

All features are enabled by default but a lot can be turned off to cut down on dependencies. With all default features enabled only the raw types are available.

  • serde: enables serialization and deserialization.
  • bootstrap: adds the Bootstrapper type.

Dependencies

~4–14MB
~148K SLoC