rust-pipe 0.1.1

Lightweight typed task dispatch from Rust to polyglot workers (TypeScript, Python, Go, Java, C#, Ruby, Elixir, Swift, PHP)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
# Worker that outputs non-JSON lines mixed with valid responses
echo "DEBUG: starting up..."
echo "WARNING: some internal log"
read -r line
task_id=$(echo "$line" | jq -r '.task.id' 2>/dev/null)
if [ -n "$task_id" ] && [ "$task_id" != "null" ]; then
  echo "{\"type\":\"TaskResult\",\"result\":{\"taskId\":\"$task_id\",\"status\":\"Completed\",\"payload\":{\"ok\":true},\"durationMs\":1,\"workerId\":\"nonjson-worker\"}}"
fi
# Output more garbage after
echo "some trailing garbage"
read -r line2
# Exit on shutdown or second message
exit 0