devout: handle readiness on netlink socket but no event
This commit is contained in:
parent
cf9cadd212
commit
b9c084415e
1 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@
|
||||||
(fn trace [expr]
|
(fn trace [expr]
|
||||||
(do (print :TRACE (view expr)) expr))
|
(do (print :TRACE (view expr)) expr))
|
||||||
|
|
||||||
(fn parse-uevent [s]
|
(fn parse-event [s]
|
||||||
(let [at (string.find s "@" 1 true)
|
(let [at (string.find s "@" 1 true)
|
||||||
(nl nxt) (string.find s "\0" 1 true)]
|
(nl nxt) (string.find s "\0" 1 true)]
|
||||||
(doto
|
(doto
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
found)))
|
found)))
|
||||||
|
|
||||||
(fn record-event [db subscribers str]
|
(fn record-event [db subscribers str]
|
||||||
(let [e (parse-uevent str)]
|
(let [e (parse-event str)]
|
||||||
(match e.action
|
(match e.action
|
||||||
:add (tset db e.path e)
|
:add (tset db e.path e)
|
||||||
:change (tset db e.path e)
|
:change (tset db e.path e)
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
subscribers []]
|
subscribers []]
|
||||||
{
|
{
|
||||||
:find (fn [_ terms] (find-in-database db terms))
|
:find (fn [_ terms] (find-in-database db terms))
|
||||||
:add (fn [_ event-string] (record-event db subscribers event-string))
|
:add (fn [_ event-string] (when event-string (record-event db subscribers event-string)))
|
||||||
:at-path (fn [_ path] (. db path))
|
:at-path (fn [_ path] (. db path))
|
||||||
:subscribe (fn [_ id callback terms]
|
:subscribe (fn [_ id callback terms]
|
||||||
(let [past-events (find-in-database db terms)]
|
(let [past-events (find-in-database db terms)]
|
||||||
|
|
Loading…
Reference in a new issue