[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [ANN] lua-epoll
- From: Phoenix Sol <phoenix@...>
- Date: Fri, 11 Sep 2009 16:05:18 -0500
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}, ... }