leaky-bucket/poc/py/test.sh

22 lines
282 B
Bash

#! /bin/bash
set -e
set -o pipefail
cleanup() {
kill -9 $(jobs -p) || true
}
trap cleanup EXIT
python3 ./state_to_buttons.py &
(
while echo ""; do
if [ 0 == $((RANDOM%4)) ]; then
sleep 3
fi
date >&2
done
) | python3 ./stream_to_state.py