liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

nl.fnl (357B)


      1 (local netlink (require :netlink))
      2 
      3 ; (local { : view } (require :fennel))
      4 
      5 (fn events [groups]
      6   (let [sock (netlink.socket)]
      7     (coroutine.wrap
      8      (fn []
      9        (each [_ e (ipairs (sock:query groups))]
     10          (coroutine.yield e))
     11        (while (sock:poll)
     12          (each [_ e (ipairs (sock:event))]
     13            (coroutine.yield e)))))))
     14 
     15 { : events }