home
/
code
/
khatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f1da640
)
Improve names
author
Siraaj Khandkar
<siraaj@khandkar.net>
Sun, 29 Jul 2018 18:28:04 +0000
(14:28 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Sun, 29 Jul 2018 18:28:04 +0000
(14:28 -0400)
bin/khatus_loop
patch
|
blob
|
blame
|
history
diff --git
a/bin/khatus_loop
b/bin/khatus_loop
index
3603e25
..
4952483
100755
(executable)
--- a/
bin/khatus_loop
+++ b/
bin/khatus_loop
@@
-2,7
+2,7
@@
MSG_TAG_SEP=': '
MSG_TAG_SEP=': '
-
fetch
_weather() {
+
produce
_weather() {
metar -d "$WEATHER_STATION_ID" 2>&1 \
| awk '
/METAR pattern not found in NOAA data/ {
metar -d "$WEATHER_STATION_ID" 2>&1 \
| awk '
/METAR pattern not found in NOAA data/ {
@@
-23,11
+23,11
@@
fetch_weather() {
}'
}
}'
}
-
fetch
_datetime() {
+
produce
_datetime() {
date +'%a %b %d %H:%M:%S'
}
date +'%a %b %d %H:%M:%S'
}
-
read_and_react
() {
+
consume
() {
pipe="$1"
tail -f "$pipe" \
| stdbuf -o L awk \
pipe="$1"
tail -f "$pipe" \
| stdbuf -o L awk \
@@
-66,7
+66,7
@@
read_and_react() {
'
}
'
}
-
trigger_bar
() {
+
produce_bar_req
() {
echo ''
}
echo ''
}
@@
-91,10
+91,10
@@
main() {
rm -f "$pipe"
mkfifo "$pipe"
rm -f "$pipe"
mkfifo "$pipe"
- spawn
fetch_datetime
"$pipe" 'in:DATE_TIME' 1
- spawn
fetch_weather
"$pipe" 'in:WEATHER' $(( 30 * 60 ))
- spawn
trigger_bar
"$pipe" 'out:BAR' 1
-
read_and_react
"$pipe"
+ spawn
produce_datetime
"$pipe" 'in:DATE_TIME' 1
+ spawn
produce_weather
"$pipe" 'in:WEATHER' $(( 30 * 60 ))
+ spawn
produce_bar_req
"$pipe" 'out:BAR' 1
+
consume
"$pipe"
}
main $@
}
main $@
This page took
0.031845 seconds
and
4
git commands to generate.