Documentation
¶
Overview ¶
Package epoll contains a thin wrapper around the epoll(7) facility.
Using epoll from Go is unusual as the language provides facilities that normally make using it directly pointless. Epoll is strictly required for unusual kernel interfaces that use event notification but don't implement file descriptors that provide usual read/write semantics.
Index ¶
- Variables
- type Epoll
- func (e *Epoll) Close() error
- func (e *Epoll) Deregister(fd int) error
- func (e *Epoll) IsClosed() bool
- func (e *Epoll) Modify(fd int, mask Readiness) error
- func (e *Epoll) Register(fd int, mask Readiness) error
- func (e *Epoll) RegisteredFdCount() int
- func (e *Epoll) Wait() ([]Event, error)
- func (e *Epoll) WaitTimeout(duration time.Duration) ([]Event, error)
- type Event
- type Readiness
Constants ¶
This section is empty.
Variables ¶
var ErrEpollClosed = errors.New("the epoll instance has been closed")
Functions ¶
This section is empty.
Types ¶
type Epoll ¶
type Epoll struct {
// contains filtered or unexported fields
}
Epoll wraps a file descriptor which can be used for I/O readiness notification.
func (*Epoll) Deregister ¶
Deregister removes the given file descriptor from the epoll instance.
Please refer to epoll_ctl(2) and EPOLL_CTL_DEL for details.
func (*Epoll) Modify ¶
Modify changes the set of monitored I/O readiness events of a previously registered file descriptor.
Please refer to epoll_ctl(2) and EPOLL_CTL_MOD for details.
func (*Epoll) Register ¶
Register registers a file descriptor and allows observing speicifc I/O readiness events.
Please refer to epoll_ctl(2) and EPOLL_CTL_ADD for details.
func (*Epoll) RegisteredFdCount ¶
RegisteredFdCount returns the number of file descriptors which are currently registered to the epoll instance.
func (*Epoll) Wait ¶
Wait blocks and waits for arrival of events on any of the added file descriptors.
func (*Epoll) WaitTimeout ¶
WaitTimeout blocks and waits with the given timeout for arrival of events on any of the added file descriptors.
A duration value of -1 milliseconds disables timeout.
Please refer to epoll_wait(2) and EPOLL_WAIT for details.
Warning, using epoll from Golang explicitly is tricky.