lib/io/epoll.rb in io-epoll-0.0.1 vs lib/io/epoll.rb in io-epoll-0.0.2
- old
+ new
@@ -25,10 +25,11 @@
fileno < 0
end
end
def self.epoll(ios, events)
+ ios = ios.to_a
open_len = ios.length
ep = Epoll.create
ios.each do |io|
ep.add(io, events)
end
@@ -41,11 +42,13 @@
open_len -= 1
ev.data.close
end
end
end
- nil
+ ep.close
else
- ep.wait
+ evlist = ep.wait
+ ep.close
+ evlist
end
end
end