2024-03-05 00:01:19 +01:00
|
|
|
(local netlink (require :netlink))
|
|
|
|
|
2024-03-11 23:16:49 +01:00
|
|
|
; (local { : view } (require :fennel))
|
2024-03-05 00:01:19 +01:00
|
|
|
|
|
|
|
(fn events [groups]
|
|
|
|
(let [sock (netlink.socket)]
|
|
|
|
(coroutine.wrap
|
|
|
|
(fn []
|
|
|
|
(each [_ e (ipairs (sock:query groups))]
|
|
|
|
(coroutine.yield e))
|
|
|
|
(while (sock:poll)
|
|
|
|
(each [_ e (ipairs (sock:event))]
|
|
|
|
(coroutine.yield e)))))))
|
|
|
|
|
|
|
|
{ : events }
|