The Epoll class provides high-level access to epoll(7) functionality in the Linux 2.6 and later kernels. It provides fork and GC-safety for Ruby objects stored within the IO object and may be passed as an argument to IO.select.
specifies whether close-on-exec flag is set for Epoll.new
registers an IO object via epoll_ctl
unregisters an IO object via epoll_ctl
modifies the registration of an IO object via epoll_ctl
watch for errors, there is no need to specify this, it is always monitored when an IO is watched
notifications are only Edge Triggered, see epoll(7)
watch for hangups, there is no need to specify this, it is always monitored when an IO is watched
watch for read/recv operations
unwatch the descriptor once any event has fired
watch for write/send operations
watch for urgent read(2) data
Watch a specified io for shutdown(SHUT_WR) on the remote-end. Available since Linux 2.6.17.
This prevents system suspend while event is ready. This requires the caller to have the CAP_BLOCK_SUSPEND capability Available since Linux 3.5
Creates a new Epoll object with an optional flags argument. flags may currently be :CLOEXEC or 0 (or nil).
Starts watching a given io object with events which may be an Integer bitmask or Array representing arrays to watch for.
Closes an existing Epoll object and returns memory back to the kernel. Raises IOError if object is already closed.
This method is deprecated and will be removed in sleepy_penguin 4.x
Stops an io object from being monitored. This is like Epoll#del but returns nil on ENOENT instead of raising an error. This is useful for apps that do not care to track the status of an epoll object itself.
This method is deprecated and will be removed in sleepy_penguin 4.x
Returns the events currently watched for in current Epoll object. Mostly used for debugging.
Changes the watch for an existing IO object based on events. Returns zero on success, will raise SystemError on failure.
This method is deprecated and will be removed in sleepy_penguin 4.x
Used to avoid exceptions when your app is too lazy to check what state a descriptor is in, this sets the epoll descriptor to watch an io with the given events
events may be an array of symbols or an unsigned Integer bit mask:
See constants in Epoll for more information.
This method is deprecated and will be removed in sleepy_penguin 4.x
Calls epoll_wait(2) and yields Integer events and IO objects watched for. maxevents is the maximum number of events to process at once, lower numbers may prevent starvation when used by epoll_wait in multiple threads. Larger maxevents reduces syscall overhead for single-threaded applications. maxevents defaults to 64 events. timeout is specified in milliseconds, nil (the default) meaning it will block and wait indefinitely.
Originally generated with the Darkfish Rdoc Generator 2, modified by wrongdoc.
We love to hear from you!