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)
|
||||
(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]
|
||||
(accumulate [match? true
|
||||
name value (pairs terms)]
|
||||
|
@ -102,7 +111,7 @@
|
|||
(db:subscribe
|
||||
client
|
||||
(fn [e]
|
||||
(ll.write client (view e)))
|
||||
(ll.write client (format-event e)))
|
||||
(parse-terms s))
|
||||
true)
|
||||
(nil err) (do (print err) false)))
|
||||
|
|
Loading…
Reference in a new issue