I was staring at the example in the readme, and considering some of the features ("replayable"), and it sounds a bit like what a Makefile does. Well, if you had a single event to process, and decided to use the filesystem to store input, intermediate results, and output.
So here's an implementation of the example from the readme using make, and bash, and jq, and a silly python script to implement a timer by modifying a file every X seconds:
~/projects/makething$ cat Makefile
default: d
b: a
curl -o $@ "http://api.coindesk.com/v1/bpi/currentprice.json"
c: b
jq '.bpi.USD.rate_float' $< > $@
d: c
cat $<
cp $< $@
~/projects/makething$ cat timer.py
import sys
import time
def main():
delay = float(sys.argv[1])
fn = sys.argv[2]
while True:
with open(fn, 'w') as f:
f.write(str(time.time()))
time.sleep(delay)
if __name__ == '__main__':
main()
~/projects/makething$ cat go.sh
#! /usr/bin/env bash
python timer.py 2.0 a &
TIMER_PID=$!
function cleanup() {
kill $TIMER_PID
}
trap cleanup EXIT
while true
do
while make -j -q
do
sleep 0.1
done
make -j
done
make decides if things are up-to-date by comparing timestamps of files in the filesystem, so we can emulate a timer that triggers an event every 2 seconds by having a process modify a file every 2 seconds, and rig a rule in our makefile to use that file as an input.