#process #supervisor #sockets #unix-socket #ipc #inter-process #communication

app psup

Process supervisor with inter-process communication over tokio Unix sockets

10 releases (5 breaking)

0.6.0 Mar 11, 2021
0.5.0 Feb 28, 2021
0.4.1 Feb 28, 2021
0.3.3 Feb 28, 2021
0.1.0 Feb 27, 2021

#26 in #supervisor

MIT/Apache

33KB
513 lines

psup

A non-blocking process supervisor that uses Unix domain sockets for inter-process communication built on tokio. Support will be added later for Windows using named pipes.

It's purpose is primarily to be used as a libary psup-impl but the psup executable can be used for testing or constrained environments where a lightweight executable could be useful. The statically linked release executable is ~2MB with symbols stripped on Linux and could be trimmed down further with a little effort.

Example communicating using JSON RPC:

cargo run --example=supervisor

An example that uses the supervisor control channel to explicitly shutdown a daemon worker process:

cargo run --example=shutdown

To test the daemon and respawn logic:

cargo run -- sample.toml
kill <PID>

Build a release:

cargo build --release && strip target/release/psup

Dual-licensed under MIT and Apache-2.

Dependencies

~7–18MB
~225K SLoC