blogs
Concurrency, done easy
Submitted by sneakin on Sat, 2011/12/03 - 22:21.I dashed this off to feed data to Graphite from my improvised security device:
#!/bin/sh
cat /dev/ttyUSB0 | ruby datecat.rb >> door_log.txt &
tail -f door_log.txt | ruby door_temp.rb | nc localhost 2003 &
tail -f door_log.txt | ruby door_opening.rb | nc localhost 2003 &
wait
Besides a lack of supervision, piping crap together is an easy way to use all of your cores.










