Skip to content
Snippets Groups Projects
  1. May 11, 2018
  2. May 09, 2018
  3. Apr 23, 2018
  4. Apr 12, 2018
  5. Mar 28, 2018
  6. Mar 01, 2018
  7. Feb 15, 2018
  8. Jan 31, 2018
  9. Jan 30, 2018
  10. Jan 24, 2018
  11. Jan 23, 2018
  12. Jan 08, 2018
    • Marek Vavruša's avatar
      daemon: unified query completion callback with trace callback in resolve · 7afffaa9
      Marek Vavruša authored
      This is a followup on addition of trace callbacks in the resolver library,
      to get rid of the Lua/C interfacing in daemon and unify it with the log tracing.
      All modules can now install completion callback on the kr_request object that
      will be called after the resolution is done.
      7afffaa9
    • Marek Vavruša's avatar
      Implement worker coroutines for asynchronous background processing · 8fa95978
      Marek Vavruša authored and Marek Vavrusa's avatar Marek Vavrusa committed
      This implements worker coroutines in Lua to perform non-blocking I/O and do many things concurrently.
      For example a file watcher can be now implemented as:
      
      ```
        local watcher = notify.opendir('/etc')
        watcher:add('hosts')
      
        -- Watch changes to /etc/hosts
        worker.coroutine(function ()
          for flags, name in watcher:changes() do
            for flag in notify.flags(flags) do
              print(name, notify[flag])
            end
          end
        end)
      ```
      
      In order to make this work, the runtime uses the cqueues library which
      can run coroutines concurrently, and return a file descriptor to poll on
      if it's blocked. The worker takes that file descriptor and calls
      `event.socket(pollfd, resume_callback)` so that libuv can wake up
      the worker when its ready again.
      
      The cqueues library is still optional, but if it's not present following stuff
      won't work:
      
      * worker.coroutine()
      * worker.sleep()
      8fa95978
  13. Jan 04, 2018
  14. Dec 21, 2017