rust-pipe
Lightweight typed task dispatch from Rust to polyglot workers (TypeScript, Python, Go, Java, C#, Ruby, Elixir, Swift, PHP).
What it does
rust-pipe sits between "raw gRPC" (too low-level) and "Temporal" (too heavy). It gives you typed task dispatch from a Rust orchestrator to workers written in any language, with:
- Worker pool management with least-loaded selection
- Heartbeat-based dead worker detection
- Backpressure signaling
- Automatic reconnection
- Graceful shutdown coordination
Transports
| Transport | Use case |
|---|---|
| WebSocket | Networked workers (multi-machine, auto-scaling pools) |
| stdio | Any CLI tool as a worker (zero SDK needed) |
| Docker | Isolated containers per task |
| SSH | Remote workers on other machines |
| WASM | Sandboxed, portable execution |
Quick start
Rust (dispatcher)
use *;
use json;
use Duration;
async
TypeScript (worker)
import { createWorker } from '@rust-pipe/worker';
const worker = createWorker({
url: 'ws://localhost:9876',
handlers: {
'scan-target': async (task) => {
// Do work...
return { vulnerabilities: 3 };
},
},
});
await worker.start();
Python (worker)
# Do work...
return
=
await
Bash (worker via stdio — no SDK needed)
#!/bin/bash
# Read JSON task from stdin, write JSON result to stdout
while ; do
task_id=
done
SDKs
| Language | Package | Install |
|---|---|---|
| TypeScript | @rust-pipe/worker |
npm install @rust-pipe/worker |
| Python | rust-pipe |
pip install rust-pipe |
| Go | rust-pipe-go |
go get github.com/albyte-ai/rust-pipe-go |
| Java | io.rustpipe:rust-pipe-worker |
Maven Central |
| C# | RustPipe.Worker |
dotnet add package RustPipe.Worker |
| Ruby | rust_pipe |
gem install rust_pipe |
| Elixir | rust_pipe |
{:rust_pipe, "~> 0.1.0"} in mix.exs |
| Swift | RustPipe |
Swift Package Manager |
| PHP | rust-pipe/worker |
composer require rust-pipe/worker |
| Any CLI | None needed | Read/write JSON on stdin/stdout |
Wire protocol
All communication uses JSON over WebSocket (or stdin/stdout for stdio transport). Messages are internally tagged with a "type" field:
All fields use camelCase. Status values: Completed, Failed, TimedOut.
Safety
- Input validation on all transport configs (prevents command injection)
- Scope enforcement via worker IDs and task types
- Resource limits on Docker/WASM transports
- Heartbeat-based dead worker detection
- Kill switch support
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.