class INotify::Notifier
def read_events
Once there are events, returns their {Event} objects.
that this notifier has watchers registered for.
Blocks until there are one or more filesystem events
def read_events size = 64 * Native::Event.size tries = 1 begin data = readpartial(size) rescue SystemCallError => er # EINVAL means that there's more data to be read # than will fit in the buffer size raise er unless er.errno == Errno::EINVAL::Errno || tries == 5 size *= 2 tries += 1 retry end events = [] cookies = {} while event = Event.consume(data, self) events << event next if event.cookie == 0 cookies[event.cookie] ||= [] cookies[event.cookie] << event end cookies.each {|c, evs| evs.each {|ev| ev.related.replace(evs - [ev]).freeze}} events end