forked from DGNum/liminix
devout: write uevent KEY=value format to clients
This commit is contained in:
parent
b33249a050
commit
324465bc18
1 changed files with 10 additions and 1 deletions
|
@ -21,6 +21,15 @@
|
||||||
(k:lower) v)
|
(k:lower) v)
|
||||||
(tset :path (string.sub s (+ at 1) (- nl 1))))))
|
(tset :path (string.sub s (+ at 1) (- nl 1))))))
|
||||||
|
|
||||||
|
(fn format-event [e]
|
||||||
|
(..
|
||||||
|
(string.format "%s@%s\0" e.action e.path)
|
||||||
|
(table.concat
|
||||||
|
(icollect [k v (pairs e)]
|
||||||
|
(string.format "%s=%s" (string.upper k) v ))
|
||||||
|
"\n")))
|
||||||
|
|
||||||
|
|
||||||
(fn event-matches? [e terms]
|
(fn event-matches? [e terms]
|
||||||
(accumulate [match? true
|
(accumulate [match? true
|
||||||
name value (pairs terms)]
|
name value (pairs terms)]
|
||||||
|
@ -102,7 +111,7 @@
|
||||||
(db:subscribe
|
(db:subscribe
|
||||||
client
|
client
|
||||||
(fn [e]
|
(fn [e]
|
||||||
(ll.write client (view e)))
|
(ll.write client (format-event e)))
|
||||||
(parse-terms s))
|
(parse-terms s))
|
||||||
true)
|
true)
|
||||||
(nil err) (do (print err) false)))
|
(nil err) (do (print err) false)))
|
||||||
|
|
Loading…
Reference in a new issue