lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


http://github.com/phoenixsol/lua-epoll

Just a thin Lua wrapper around the epoll API.  I'd appreciate feedback.

  require 'epoll'

  epoll_size = 4092 --approximate number of fds to be monitored
  num_events = 4092 --max number of events to be gathered per poll

  ep = epoll.init(epoll_size, num_events)

  ep:add(somefileno, epoll.EPOLLOUT)
  ep:mod(somefileno, epoll.EPOLLIN)
  ep:del(somefileno)

  evtable = epoll:poll(timeout)

returned evtable looks like this: { {fd = event_bitmask}, ... }